9 #ifndef __PKI_PROTOCOL_H__    10 #define __PKI_PROTOCOL_H__    29     size_t host_cert_chain_len,  
    31     size_t dev_ca_cert_chain_len,
    34     size_t private_key_len,      
    53     size_t host_cert_chain_len 
    71     size_t dev_ca_cert_chain_len 
   118     brp_frame dev_cert_chain,   
   119     brp_frame host_cert_chain,  
   146     unsigned long seq_ctr, 
   167     unsigned long seq_ctr, 
   208     size_t peristent_buf_size,    
   212     size_t * persistent_buf_actlen
   254     size_t persistent_buf_size   
   271     size_t dev_cert_buf_size,    
   276     size_t * dev_cert_len        
 BRP_LIB brp_errcode brp_pki_get_dev_cert(brp_protocol protocol, brp_buf dev_cert_buf, size_t dev_cert_buf_size, size_t *dev_cert_len)
This command retrieves the certificate of the device which it created a PKI connection to...
 
BRP_LIB brp_errcode brp_append_dev_ca_certs(brp_protocol protocol, brp_buf dev_ca_cert_chain, size_t dev_ca_cert_chain_len)
Adds certificate(s) to the devices CA certificate chain. 
 
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions. 
 
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol. 
 
BRP_LIB brp_protocol brp_create_pki(int security_level, brp_buf host_cert_chain, size_t host_cert_chain_len, brp_buf dev_ca_cert_chain, size_t dev_ca_cert_chain_len, brp_buf private_key, size_t private_key_len, brp_time session_timeout)
Creates a new PKI protocol layer. 
 
unsigned long brp_time
absolute/relative timeout/delay in ms. 
 
This file primarly defines the common part of all protocol's data structures (:brp_protocol_t) and AP...
 
BRP_LIB brp_errcode brp_pki_restore_session(brp_protocol protocol, brp_buf persistent_buf, size_t persistent_buf_size)
This command reloads the current PKI session that was stored by brp_pki_save_session(). 
 
BRP_LIB brp_errcode brp_pki_save_session(brp_protocol protocol, brp_buf persistent_buf, size_t peristent_buf_size, size_t *persistent_buf_actlen)
This command stores the current PKI session state in a persistent storage for being continued later u...
 
BRP_LIB size_t brp_pki_get_session_buf_size(brp_protocol protocol)
Returns the size of the buffer required to store the session state using brp_pki_save_session(). 
 
BRP_LIB brp_errcode brp_append_host_certs(brp_protocol protocol, brp_buf host_cert_chain, size_t host_cert_chain_len)
Adds certificate(s) to the host certificate chain. 
 
unsigned char * brp_buf
represents a pointer to a protocol data buffer.