ndn-lite
Data Structures | Typedefs | Functions
access-control.h File Reference
#include "../encode/interest.h"
#include "../encode/data.h"

Go to the source code of this file.

Data Structures

struct  ndn_ac_unfinished_key
 The structure to present an unfinished key only used in Access Control EK/DK process. More...
 
struct  ndn_ac_state
 The structure to implement state storage and management in Access Control. More...
 

Typedefs

typedef struct ndn_ac_unfinished_key ndn_ac_unfinished_key_t
 The structure to present an unfinished key only used in Access Control EK/DK process. More...
 
typedef struct ndn_ac_state ndn_ac_state_t
 The structure to implement state storage and management in Access Control. More...
 

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)
 

Typedef Documentation

◆ ndn_ac_state_t

typedef struct ndn_ac_state ndn_ac_state_t

The structure to implement state storage and management in Access Control.

◆ ndn_ac_unfinished_key_t

The structure to present an unfinished key only used in Access Control EK/DK process.

Library users should not declare this structure in application.

Function Documentation

◆ ndn_ac_on_dk_response_process()

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.

Parameters
data.Input. Decoded and signature verified Decryption Request's Response Packet.
Returns
0 if there is no error.

◆ ndn_ac_on_ek_response_process()

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.

Parameters
data.Input. Decoded and signature verified Encryption Request's Response Packet.
Returns
0 if there is no error.

◆ ndn_ac_on_interest_process()

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.

Parameters
response.Output. Prepared Response.
interest.Input. Decoded and signature verified signed interest.
Returns
0 if there is no error.

◆ ndn_ac_prepare_dk_response()

int ndn_ac_prepare_dk_response ( ndn_decoder_t decoder,
const ndn_interest_t interest,
ndn_data_t response 
)

◆ ndn_ac_prepare_ek_response()

int ndn_ac_prepare_ek_response ( ndn_decoder_t decoder,
const ndn_interest_t interest,
ndn_data_t response 
)

◆ ndn_ac_prepare_key_request_interest()

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.

Parameters
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.
Returns
0 if there is no error.

◆ ndn_ac_state_init()

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.

Parameters
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.