11 #ifndef NDN_ENCODING_DATA_H 12 #define NDN_ENCODING_DATA_H 16 #include "../security/ndn-lite-hmac.h" 17 #include "../security/ndn-lite-ecc.h" 18 #include "../security/ndn-lite-sha.h" 19 #include "../security/ndn-lite-aes.h" 183 const uint8_t* content_value, uint32_t content_size,
184 const ndn_name_t* key_id,
const uint8_t* aes_iv,
201 uint8_t* content_value, uint32_t* content_used_size,
208 #endif // NDN_ENCODING_DATA_H ndn_signature_t signature
Data Signature.
Definition: data.h:52
int ndn_data_tlv_encode_ecdsa_sign(ndn_encoder_t *encoder, ndn_data_t *data, const ndn_name_t *producer_identity, const ndn_ecc_prv_t *prv_key)
Use ECDSA Algorithm to sign the Data and encode the Data into wire format.
Definition: data.c:128
The structure to keep a HMAC key.
Definition: ndn-lite-hmac.h:65
int ndn_data_parse_encrypted_content(const ndn_data_t *data, uint8_t *content_value, uint32_t *content_used_size, ndn_name_t *key_id, uint8_t *aes_iv, const ndn_aes_key_t *key)
Parse the Data encrypted content and get the decrypted content.
Definition: data.c:589
int ndn_data_tlv_encode_digest_sign(ndn_encoder_t *encoder, ndn_data_t *data)
Use Digest (SHA256) to sign the Data and encode the Data into wire format.
Definition: data.c:80
The structure to represent an NDN Data packet The best practice of using ndn_data_t is to first decla...
Definition: data.h:30
int ndn_data_tlv_decode_hmac_verify(ndn_data_t *data, const uint8_t *block_value, uint32_t block_size, const ndn_hmac_key_t *hmac_key)
Decode the encoded Data into a ndn_data_t and verify the HMAC signature.
Definition: data.c:463
int ndn_data_tlv_encode_hmac_sign(ndn_encoder_t *encoder, ndn_data_t *data, const ndn_name_t *producer_identity, const ndn_hmac_key_t *hmac_key)
Use HMAC Algorithm to sign the Data and encode the Data into wire format.
Definition: data.c:215
The structure to keep an ECC private key.
Definition: ndn-lite-ecc.h:86
int ndn_data_tlv_decode_ecdsa_verify(ndn_data_t *data, const uint8_t *block_value, uint32_t block_size, const ndn_ecc_pub_t *pub_key)
Decode the encoded Data into a ndn_data_t and verify the ECDSA signature.
Definition: data.c:393
int ndn_data_set_encrypted_content(ndn_data_t *data, const uint8_t *content_value, uint32_t content_size, const ndn_name_t *key_id, const uint8_t *aes_iv, const ndn_aes_key_t *key)
Set the Data content with the encrypted content.
Definition: data.c:533
#define NDN_CONTENT_BUFFER_SIZE
Definition: ndn-constants.h:33
uint8_t content_value[NDN_CONTENT_BUFFER_SIZE]
Data Content Value (not including T and L)
Definition: data.h:42
ndn_metainfo_t metainfo
Data MetaInfo Value (not including T and L)
Definition: data.h:38
The structure to represent the Name.
Definition: name.h:24
The structure to keep an AES-128 key.
Definition: ndn-lite-aes.h:56
static void ndn_data_init(ndn_data_t *data)
Init an Data packet.
Definition: data.h:63
The structure to represent the Signature.
Definition: signature.h:38
static int ndn_data_set_content(ndn_data_t *data, uint8_t *content_value, uint32_t content_size)
Set the Data content.
Definition: data.h:159
ndn_name_t name
Data Name Value (not including T and L)
Definition: data.h:34
uint32_t content_size
Data MetaInfo Content Value Size.
Definition: data.h:46
struct ndn_data ndn_data_t
The structure to represent an NDN Data packet The best practice of using ndn_data_t is to first decla...
#define NDN_OVERSIZE
The object given is larger than expected.
Definition: ndn-error-code.h:33
The structure to keep the state when doing NDN TLV encoding.
Definition: encoder.h:31
int ndn_data_tlv_decode_digest_verify(ndn_data_t *data, const uint8_t *block_value, uint32_t block_size)
Decode the encoded Data into a ndn_data_t and verify the Digest (SHA256) signature.
Definition: data.c:325
The structure to keep an ECC public key.
Definition: ndn-lite-ecc.h:71
int ndn_data_tlv_decode_no_verify(ndn_data_t *data, const uint8_t *block_value, uint32_t block_size)
Simply decode the encoded Data into a ndn_data_t without signature verification.
Definition: data.c:263