C API for BALTECH SDK

§ brp_create_pki()

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.

This protocol layer will manage all PKI relevant encryption and authentication on top of another BRP protocol layer.

Returns
A BRP protocol on success or NULL on failure. All commands executed via the returned protocol are transferred encrypted.
Parameters
security_levelsecurity level that shall be authenticated
host_cert_chainhost certificate chain in ASN.1 DER format
host_cert_chain_lenlength of 'host_cert_chain' in bytes
dev_ca_cert_chaindevice's certificate authority's certificate chain in ASN.1 DER format
dev_ca_cert_chain_lenlength of 'dev_ca_cert_chain' in bytes
private_keyprivate key of host in ASN.1 DER format
private_key_lenlength of 'private_key' in bytes
session_timeouttimeout in ms how long session shall be valid. If 0, the session is valid until reboot or a new session is started.