Starting with version 3.7.7, the atcacert module APIs have been modified to support TA Compressed certificates. Instead of passing raw buffers, APIs now accept the cal_buffer structure. This structure ensures that the length of the data is bundled with the buffer, which is particularly useful for resource-constrained devices and multipart buffers.
To initialize a cal_buffer, use the provided convenience macros:
CAL_BUF_INIT(length, pointer): Standard initialization for a single buffer.CAL_BUF_INIT_LINK: Used only when multipart buffers are enabled (rare).
uint8_t signer_ca_public_key[64] = { 0 };
cal_buffer signer_ca_public_key_buf = CAL_BUF_INIT(sizeof(signer_ca_public_key), signer_ca_public_key);
status = atcacert_read_cert(&cert_def, &signer_ca_public_key_buf, cert, &cert_size);