![]() |
ndn-lite
|
#include "access-control.h"
#include "../encode/signed-interest.h"
#include "../encode/key-storage.h"
#include "../security/ndn-lite-aes.h"
#include "../security/ndn-lite-rng.h"
#include "../security/ndn-lite-ecc.h"
#include "../security/ndn-lite-hmac.h"
Functions | |
void | ndn_ac_state_init (const ndn_name_t *self_identity, const ndn_ecc_pub_t *self_pub_key, const ndn_ecc_prv_t *self_prv_key) |
Init a Access Control State structure. More... | |
int | ndn_ac_prepare_key_request_interest (ndn_encoder_t *encoder, const ndn_name_t *home_prefix, const name_component_t *self_identity, uint32_t ac_key_id, const ndn_ecc_prv_t *prv_key, uint8_t is_ek) |
Prepare a Key Request to send. More... | |
int | ndn_ac_on_ek_response_process (const ndn_data_t *data) |
Process Encryption Request's Response. More... | |
int | ndn_ac_on_dk_response_process (const ndn_data_t *data) |
Process Deryption Request's Response. More... | |
int | ndn_ac_on_interest_process (ndn_data_t *response, const ndn_interest_t *interest) |
Process Access Control Request. More... | |
int | ndn_ac_prepare_ek_response (ndn_decoder_t *decoder, const ndn_interest_t *interest, ndn_data_t *response) |
int | ndn_ac_prepare_dk_response (ndn_decoder_t *decoder, const ndn_interest_t *interest, ndn_data_t *response) |
Variables | |
static ndn_ac_unfinished_key_t | unfinished_key |
static ndn_ac_state_t | ac_state |
int ndn_ac_on_dk_response_process | ( | const ndn_data_t * | data | ) |
Process Deryption Request's Response.
This function will automatically set and update Access Control State.
data. | Input. Decoded and signature verified Decryption Request's Response Packet. |
int ndn_ac_on_ek_response_process | ( | const ndn_data_t * | data | ) |
Process Encryption Request's Response.
This function will automatically set and update Access Control State.
data. | Input. Decoded and signature verified Encryption Request's Response Packet. |
int ndn_ac_on_interest_process | ( | ndn_data_t * | response, |
const ndn_interest_t * | interest | ||
) |
Process Access Control Request.
This function will automatically set and update Access Control State on the access controller side.
response. | Output. Prepared Response. |
interest. | Input. Decoded and signature verified signed interest. |
int ndn_ac_prepare_dk_response | ( | ndn_decoder_t * | decoder, |
const ndn_interest_t * | interest, | ||
ndn_data_t * | response | ||
) |
int ndn_ac_prepare_ek_response | ( | ndn_decoder_t * | decoder, |
const ndn_interest_t * | interest, | ||
ndn_data_t * | response | ||
) |
int ndn_ac_prepare_key_request_interest | ( | ndn_encoder_t * | encoder, |
const ndn_name_t * | home_prefix, | ||
const name_component_t * | self_identity, | ||
uint32_t | ac_key_id, | ||
const ndn_ecc_prv_t * | prv_key, | ||
uint8_t | is_ek | ||
) |
Prepare a Key Request to send.
This function will automatically sign and encode the interest.
encoder. | Output. The encoder to keep the encoded Key Request. The encoder should be inited to proper output buffer. |
home_prefix. | Input. The network home prefix to configure the state manager. |
self_identity. | Input. The local state manager identity. |
prv_key. | Input. The ECC private key used to sign the interest. |
is_ek. | Input. Determine whether to encode a Encryption Request or Decryption Request. |
void ndn_ac_state_init | ( | const ndn_name_t * | self_identity, |
const ndn_ecc_pub_t * | self_pub_key, | ||
const ndn_ecc_prv_t * | self_prv_key | ||
) |
Init a Access Control State structure.
self_identity. | Input. Local state manager identity. |
self_pub_key. | Input. The identity ECC public key. |
self_prv_key. | Input. The identity ECC private key. |
|
static |
|
static |