![]() |
ndn-lite
|
Go to the source code of this file.
Data Structures | |
struct | ndn_validity_period |
The structure to represent the signature validity period. More... | |
struct | ndn_signature |
The structure to represent the Signature. More... | |
Typedefs | |
typedef struct ndn_validity_period | ndn_validity_period_t |
The structure to represent the signature validity period. More... | |
typedef struct ndn_signature | ndn_signature_t |
The structure to represent the Signature. More... | |
Functions | |
static int | ndn_signature_init (ndn_signature_t *signature) |
Init a Signature structure. More... | |
static int | ndn_signature_set_signature_type (ndn_signature_t *signature, uint8_t type) |
static int | ndn_signature_set_signature (ndn_signature_t *signature, const uint8_t *sig_value, size_t sig_size) |
Set signature value of the Signature. More... | |
static void | ndn_signature_set_key_locator (ndn_signature_t *signature, const ndn_name_t *key_name) |
Set keylocator of the Signature. More... | |
static void | ndn_signature_set_timestamp (ndn_signature_t *signature, uint64_t timestamp) |
Set Timestamp of the Signature. More... | |
static void | ndn_signature_set_signature_nonce (ndn_signature_t *signature, uint32_t nonce) |
Set Nonce of the Signed Interest. More... | |
static void | ndn_signature_set_seqnum (ndn_signature_t *signature, uint32_t seqnum) |
Set SeqNum of the Signed Interest. More... | |
static void | ndn_signature_set_validity_period (ndn_signature_t *signature, const uint8_t *not_before, const uint8_t *not_after) |
Set validity period of the Signature. More... | |
static uint32_t | ndn_signature_info_probe_block_size (const ndn_signature_t *signature) |
Probe the size of a Signature info TLV block before encoding it from a Signature structure. More... | |
static uint32_t | ndn_signature_value_probe_block_size (const ndn_signature_t *signature) |
Probe the size of a Signature value TLV block before encoding it from a Signature structure. More... | |
int | ndn_signature_info_tlv_encode (ndn_encoder_t *encoder, const ndn_signature_t *signature) |
Encode the Signature info into wire format (TLV block) from Signature structure. More... | |
int | ndn_signature_value_tlv_encode (ndn_encoder_t *encoder, const ndn_signature_t *signature) |
Encode the Signature value into wire format (TLV block) from Signature structure. More... | |
int | ndn_signature_info_tlv_decode (ndn_decoder_t *decoder, ndn_signature_t *signature) |
Decode an Signature info TLV block into an Signature structure. More... | |
int | ndn_signature_value_tlv_decode (ndn_decoder_t *decoder, ndn_signature_t *signature) |
Decode an Signature value TLV block into an Signature structure. More... | |
typedef struct ndn_signature ndn_signature_t |
The structure to represent the Signature.
We don't support key digest as KeyLocator in ndn-lite.
typedef struct ndn_validity_period ndn_validity_period_t |
The structure to represent the signature validity period.
This is designed for but not limited to the use of certificate.
|
inlinestatic |
Probe the size of a Signature info TLV block before encoding it from a Signature structure.
This function is used to check whether the output buffer size is enough or not.
signature. | Input. The signature structure to be probed. |
int ndn_signature_info_tlv_decode | ( | ndn_decoder_t * | decoder, |
ndn_signature_t * | signature | ||
) |
Decode an Signature info TLV block into an Signature structure.
This function will do memory copy.
decoder. | Input. The decoder who keeps the decoding result and the state. |
signature. | Output. The Signature structure whose signature info to be decoded. |
int ndn_signature_info_tlv_encode | ( | ndn_encoder_t * | encoder, |
const ndn_signature_t * | signature | ||
) |
Encode the Signature info into wire format (TLV block) from Signature structure.
encoder. | Output. The encoder who keeps the encoding result and the state. |
signature. | Input. The Signature structure whose signature info to be encoded. |
|
inlinestatic |
Init a Signature structure.
set signature type, signature size, and disable keylocator and validity period by default.
signature. | Output. The Signature structure to be inited. |
type. | Input. The signature type. |
|
inlinestatic |
Set keylocator of the Signature.
This function will do memory copy.
signature. | Output. The Signature whose keylocator will be set. |
key_name. | Input. The input keylocator. |
|
inlinestatic |
Set SeqNum of the Signed Interest.
interest. | Output. The Interest whose Nonce SeqNum be set. |
SeqNum. | Input. SeqNum value. |
|
inlinestatic |
Set signature value of the Signature.
This function will do memory copy.
signature. | Output. The Signature whose signature value will be set. |
sig_value. | Input. The buffer which holds the input signature value. |
sig_size. | Input. Size of input buffer. |
|
inlinestatic |
Set Nonce of the Signed Interest.
interest. | Output. The Interest whose Nonce will be set. |
nonce. | Input. Nonce value. |
|
inlinestatic |
|
inlinestatic |
Set Timestamp of the Signature.
A Timestamp should be set when using a signed Interest.
signature. | Output. The Signature whose Timestamp will be set. |
timestamp. | Input. Timestamp value. |
|
inlinestatic |
Set validity period of the Signature.
This function will do memory copy. not before and not after must be ISO 8601 time format, which is 15 bytes long.
signature. | Output. The Signature whose validity period will be set. |
not_before. | Input. The input not_before time. |
not_after. | Input. The input not_after time. |
|
inlinestatic |
Probe the size of a Signature value TLV block before encoding it from a Signature structure.
This function is used to check whether the output buffer size is enough or not.
signature. | Input. The signature structure to be probed. |
int ndn_signature_value_tlv_decode | ( | ndn_decoder_t * | decoder, |
ndn_signature_t * | signature | ||
) |
Decode an Signature value TLV block into an Signature structure.
This function will do memory copy.
decoder. | Input. The decoder who keeps the decoding result and the state. |
signature. | Output. The Signature structure whose signature value to be decoded. |
int ndn_signature_value_tlv_encode | ( | ndn_encoder_t * | encoder, |
const ndn_signature_t * | signature | ||
) |
Encode the Signature value into wire format (TLV block) from Signature structure.
encoder. | Output. The encoder who keeps the encoding result and the state. |
signature. | Input. The Signature structure whose signature value to be encoded. |