CryptoAuthLib v3.7.7
Microchip CryptoAuthentication Library
 
Loading...
Searching...
No Matches
atcacert_client.h File Reference

Client side cert i/o methods. These declarations deal with the client-side, the node being authenticated, of the authentication process. It is assumed the client has an ECC CryptoAuthentication device (e.g. ATECC508A) and the certificates are stored on that device. More...

#include <stddef.h>
#include <stdint.h>
#include "atcacert_def.h"

Functions

ATCA_STATUS atcacert_read_cert (const atcacert_def_t *cert_def, const cal_buffer *ca_public_key, uint8_t *cert, size_t *cert_size)
 Reads the certificate specified by the certificate definition from the ATECC508A device.
 
ATCA_STATUS atcacert_read_cert_ext (ATCADevice device, const atcacert_def_t *cert_def, const cal_buffer *ca_public_key, uint8_t *cert, size_t *cert_size)
 Reads the certificate specified by the certificate definition from the ATECC508A device.
 
ATCA_STATUS atcacert_write_cert (const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size)
 Take a full certificate and write it to the ATECC508A device according to the certificate definition.
 
ATCA_STATUS atcacert_write_cert_ext (ATCADevice device, const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size)
 Take a full certificate and write it to the ATECC508A device according to the certificate definition.
 
ATCA_STATUS atcacert_read_cert_size (const atcacert_def_t *cert_def, size_t *cert_size)
 Return the actual certificate size in bytes for a given cert def. Certificate can be variable size, so this gives the absolute buffer size when reading the certificates.
 
ATCA_STATUS atcacert_read_cert_size_ext (ATCADevice device, const atcacert_def_t *cert_def, size_t *cert_size)
 Return the actual certificate size in bytes for a given cert def. Certificate can be variable size, so this gives the absolute buffer size when reading the certificates.
 

Detailed Description

Client side cert i/o methods. These declarations deal with the client-side, the node being authenticated, of the authentication process. It is assumed the client has an ECC CryptoAuthentication device (e.g. ATECC508A) and the certificates are stored on that device.

Function Documentation

◆ atcacert_read_cert()

ATCA_STATUS atcacert_read_cert ( const atcacert_def_t cert_def,
const cal_buffer ca_public_key,
uint8_t *  cert,
size_t *  cert_size 
)

Reads the certificate specified by the certificate definition from the ATECC508A device.

This process involves reading the dynamic cert data from the device and combining it with the template found in the certificate definition.

Parameters
[in]cert_defCertificate definition describing where to find the dynamic certificate information on the device and how to incorporate it into the template.
[in]ca_public_keyBuffer pointing to the ECC P256/P384/P521 public key of the certificate authority that signed this certificate. Formatted as X and Y integers concatenated together. Set to NULL if the authority key id is not needed, set properly in the cert_def template, or stored on the device as specifed in the cert_def cert_elements.
[out]certBuffer to received the certificate.
[in,out]cert_sizeAs input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes.
Returns
ATCACERT_E_SUCCESS on success, otherwise an error code.

◆ atcacert_read_cert_ext()

ATCA_STATUS atcacert_read_cert_ext ( ATCADevice  device,
const atcacert_def_t cert_def,
const cal_buffer ca_public_key,
uint8_t *  cert,
size_t *  cert_size 
)

Reads the certificate specified by the certificate definition from the ATECC508A device.

This process involves reading the dynamic cert data from the device and combining it with the template found in the certificate definition.

Parameters
[in]deviceDevice context pointer
[in]cert_defCertificate definition describing where to find the dynamic certificate information on the device and how to incorporate it into the template.
[in]ca_public_keyBuffer pointing to the public key of the certificate authority that signed this certificate. Formatted as X and Y integers concatenated together. Set to NULL if the authority key id is not needed, set properly in the cert_def template, or stored on the device as specifed in the cert_def cert_elements.
[out]certBuffer to received the certificate.
[in,out]cert_sizeAs input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes.
Returns
ATCACERT_E_SUCCESS on success, otherwise an error code.

◆ atcacert_read_cert_size()

ATCA_STATUS atcacert_read_cert_size ( const atcacert_def_t cert_def,
size_t *  cert_size 
)

Return the actual certificate size in bytes for a given cert def. Certificate can be variable size, so this gives the absolute buffer size when reading the certificates.

Parameters
[in]cert_defCertificate definition to find a max size for.
[out]cert_sizeCertificate size will be returned here in bytes.
Returns
ATCACERT_E_SUCCESS on success, otherwise an error code.

◆ atcacert_read_cert_size_ext()

ATCA_STATUS atcacert_read_cert_size_ext ( ATCADevice  device,
const atcacert_def_t cert_def,
size_t *  cert_size 
)

Return the actual certificate size in bytes for a given cert def. Certificate can be variable size, so this gives the absolute buffer size when reading the certificates.

Parameters
[in]deviceDevice context
[in]cert_defCertificate definition to find a max size for.
[out]cert_sizeCertificate size will be returned here in bytes.
Returns
ATCACERT_E_SUCCESS on success, otherwise an error code.

◆ atcacert_write_cert()

ATCA_STATUS atcacert_write_cert ( const atcacert_def_t cert_def,
const uint8_t *  cert,
size_t  cert_size 
)

Take a full certificate and write it to the ATECC508A device according to the certificate definition.

Parameters
[in]cert_defCertificate definition describing where the dynamic certificate information is and how to store it on the device.
[in]certFull certificate to be stored.
[in]cert_sizeSize of the full certificate in bytes.
[in]deviceDevice context
Returns
ATCACERT_E_SUCCESS on success, otherwise an error code.

◆ atcacert_write_cert_ext()

ATCA_STATUS atcacert_write_cert_ext ( ATCADevice  device,
const atcacert_def_t cert_def,
const uint8_t *  cert,
size_t  cert_size 
)

Take a full certificate and write it to the ATECC508A device according to the certificate definition.

Parameters
[in]deviceDevice context
[in]cert_defCertificate definition describing where the dynamic certificate information is and how to store it on the device.
[in]certFull certificate to be stored.
[in]cert_sizeSize of the full certificate in bytes.
[in]deviceDevice context
Returns
ATCACERT_E_SUCCESS on success, otherwise an error code.