Function anj_crypto_storage_get_persistence_info

Function Documentation

int anj_crypto_storage_get_persistence_info(void *crypto_ctx, const anj_crypto_security_info_external_t *info, void *out_data, size_t *out_data_size)

Serializes key or certificate identification data from anj_crypto_security_info_external_t into the ANJ_DATA_TYPE_BYTES format for persistence.

This function is called by the Security Object to convert the given info into a byte array. The resulting data can be deserialized back into an anj_crypto_security_info_external_t using anj_crypto_storage_resolve_persistence_info.

Note

out_data_size can’t exceed ANJ_CRYPTO_STORAGE_PERSISTENCE_INFO_MAX_SIZE.

Parameters:
  • crypto_ctx – Cryptographic context.

  • info – Key or certificate identifier used to retrieve the data.

  • out_data[out] Pointer to the data buffer.

  • out_data_size[out] Size of the retrieved data.

Returns:

0 on success, or a negative value on failure.