ndn-lite
Data Structures | Typedefs | Functions
key-storage.h File Reference
#include "data.h"

Go to the source code of this file.

Data Structures

struct  ndn_key_storage
 The structure to implement keys storage and management. More...
 

Typedefs

typedef struct ndn_key_storage ndn_key_storage_t
 The structure to implement keys storage and management. More...
 

Functions

ndn_key_storage_tndn_key_storage_init (void)
 Init an in-library key storage structure. More...
 
ndn_key_storage_tndn_key_storage_get_instance (void)
 Get a running instance of key storage structure. More...
 
int ndn_key_storage_set_anchor (const ndn_data_t *trust_anchor)
 Set trust anchor for the key storage structure. More...
 
void ndn_key_storage_get_empty_hmac_key (ndn_hmac_key_t **hmac)
 Get an empty HMAC key pointer from key storage structure. More...
 
void ndn_key_storage_get_empty_ecc_key (ndn_ecc_pub_t **pub, ndn_ecc_prv_t **prv)
 Get an empty ECC key pointer from key storage structure. More...
 
void ndn_key_storage_get_empty_aes_key (ndn_aes_key_t **aes)
 Get an empty AES-128 key pointer from key storage structure. More...
 
void ndn_key_storage_delete_hmac_key (uint32_t key_id)
 Delete a HMAC key by searching corresponding unique key id. More...
 
void ndn_key_storage_delete_ecc_key (uint32_t key_id)
 Delete a ECC key by searching corresponding unique key id. More...
 
void ndn_key_storage_delete_aes_key (uint32_t key_id)
 Delete a AES-128 key by searching corresponding unique key id. More...
 
void ndn_key_storage_get_hmac_key (uint32_t key_id, ndn_hmac_key_t **hmac)
 Get an empty HMAC key pointer from key storage structure. More...
 
void ndn_key_storage_get_ecc_key (uint32_t key_id, ndn_ecc_pub_t **pub, ndn_ecc_prv_t **prv)
 Get an empty ECC key pointer from key storage structure. More...
 
void ndn_key_storage_get_aes_key (uint32_t key_id, ndn_aes_key_t **aes)
 Get an empty AES-128 key pointer from key storage structure. More...
 

Typedef Documentation

◆ ndn_key_storage_t

The structure to implement keys storage and management.

Function Documentation

◆ ndn_key_storage_delete_aes_key()

void ndn_key_storage_delete_aes_key ( uint32_t  key_id)

Delete a AES-128 key by searching corresponding unique key id.

Parameters
key_id.Input. Key id of the key to delete.

◆ ndn_key_storage_delete_ecc_key()

void ndn_key_storage_delete_ecc_key ( uint32_t  key_id)

Delete a ECC key by searching corresponding unique key id.

Parameters
key_id.Input. Key id of the key to delete.

◆ ndn_key_storage_delete_hmac_key()

void ndn_key_storage_delete_hmac_key ( uint32_t  key_id)

Delete a HMAC key by searching corresponding unique key id.

Parameters
key_id.Input. Key id of the key to delete.

◆ ndn_key_storage_get_aes_key()

void ndn_key_storage_get_aes_key ( uint32_t  key_id,
ndn_aes_key_t **  aes 
)

Get an empty AES-128 key pointer from key storage structure.

Parameters
key_id.Input. Key id which indicates the key to fetch.
hmac.Output. Pass NULL pointers into the function to get output AES-128 key pointers.

◆ ndn_key_storage_get_ecc_key()

void ndn_key_storage_get_ecc_key ( uint32_t  key_id,
ndn_ecc_pub_t **  pub,
ndn_ecc_prv_t **  prv 
)

Get an empty ECC key pointer from key storage structure.

Parameters
key_id.Input. Key id which indicates the key to fetch.
hmac.Output. Pass NULL pointers into the function to get output ECC key pointers.

◆ ndn_key_storage_get_empty_aes_key()

void ndn_key_storage_get_empty_aes_key ( ndn_aes_key_t **  aes)

Get an empty AES-128 key pointer from key storage structure.

Parameters
aes.Output. Pass NULL pointers into the function to get empty ECC key pointers.

◆ ndn_key_storage_get_empty_ecc_key()

void ndn_key_storage_get_empty_ecc_key ( ndn_ecc_pub_t **  pub,
ndn_ecc_prv_t **  prv 
)

Get an empty ECC key pointer from key storage structure.

Parameters
pub.Output. Pass NULL pointers into the function to get empty ECC key pointers.
prv.Output. Pass NULL pointers into the function to get empty ECC key pointers.

◆ ndn_key_storage_get_empty_hmac_key()

void ndn_key_storage_get_empty_hmac_key ( ndn_hmac_key_t **  hmac)

Get an empty HMAC key pointer from key storage structure.

Parameters
hmac.Output. Pass NULL pointers into the function to get empty HMAC key pointers.

◆ ndn_key_storage_get_hmac_key()

void ndn_key_storage_get_hmac_key ( uint32_t  key_id,
ndn_hmac_key_t **  hmac 
)

Get an empty HMAC key pointer from key storage structure.

Parameters
key_id.Input. Key id which indicates the key to fetch.
hmac.Output. Pass NULL pointers into the function to get output hmac key pointers.

◆ ndn_key_storage_get_instance()

ndn_key_storage_t* ndn_key_storage_get_instance ( void  )

Get a running instance of key storage structure.

Returns
the pointer to the ket storage instance.

◆ ndn_key_storage_init()

ndn_key_storage_t* ndn_key_storage_init ( void  )

Init an in-library key storage structure.

Returns
The pointer to the initialized key storage structure

◆ ndn_key_storage_set_anchor()

int ndn_key_storage_set_anchor ( const ndn_data_t trust_anchor)

Set trust anchor for the key storage structure.

Parameters
trust_anchor.Input. Trust anchor to configure the key storage structure.
Returns
0 if there is no error.