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"
|
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.
|
|
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.
- Copyright
- (c) 2015-2020 Microchip Technology Inc. and its subsidiaries.
◆ 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_def | Certificate definition describing where to find the dynamic certificate information on the device and how to incorporate it into the template. |
[in] | ca_public_key | Buffer 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] | cert | Buffer to received the certificate. |
[in,out] | cert_size | As 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()
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] | device | Device context pointer |
[in] | cert_def | Certificate definition describing where to find the dynamic certificate information on the device and how to incorporate it into the template. |
[in] | ca_public_key | Buffer 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] | cert | Buffer to received the certificate. |
[in,out] | cert_size | As 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_def | Certificate definition to find a max size for. |
[out] | cert_size | Certificate size will be returned here in bytes. |
- Returns
- ATCACERT_E_SUCCESS on success, otherwise an error code.
◆ atcacert_read_cert_size_ext()
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] | device | Device context |
[in] | cert_def | Certificate definition to find a max size for. |
[out] | cert_size | Certificate 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_def | Certificate definition describing where the dynamic certificate information is and how to store it on the device. |
[in] | cert | Full certificate to be stored. |
[in] | cert_size | Size of the full certificate in bytes. |
[in] | device | Device 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] | device | Device context |
[in] | cert_def | Certificate definition describing where the dynamic certificate information is and how to store it on the device. |
[in] | cert | Full certificate to be stored. |
[in] | cert_size | Size of the full certificate in bytes. |
[in] | device | Device context |
- Returns
- ATCACERT_E_SUCCESS on success, otherwise an error code.