Typedef anj_security_offload_keys_and_certs_handler_t

Typedef Documentation

typedef int anj_security_offload_keys_and_certs_handler_t(anj_t *anj)

Moves newly configured security credentials (certificates and keys) from Security Object instances to external storage and removes credentials that are no longer used.

This callback is called in two scenarios:

  1. After a successful Bootstrap Finish, i.e. only after the Bootstrap process has completed successfully and the newly provisioned Security Object state has been accepted.

  2. By anj_dm_security_obj_install(), when using the default Security Object implementation, to move credentials to external storage immediately after the object is installed.

The implementation is expected to move any new credentials to external storage, unless they are already stored there, and to remove credentials from external storage that have been overwritten or deleted from the Security Object. Moving credentials to external storage may involve copying the credential data and securely erasing the original in-memory buffers.

Warning

If moving credentials to external storage fails, the implementation MUST restore the affected credentials to the in-memory buffers, so that they remain available and the Security Object state can still be used safely.

Param anj:

Anjay object used to access the Security Object and the crypto context.

Return:

0 in case of success, negative value in case of error.