Function anj_crypto_storage_store_data
Defined in File storage.h
Function Documentation
-
int anj_crypto_storage_store_data(void *crypto_ctx, const anj_crypto_security_info_t *info, const void *data, size_t data_size, bool last_chunk)
Stores certificate or key data in the specified security record.
This function is always called after a successful call to anj_crypto_storage_create_new_record for the same security record.
This function is called to store a portion (or the entirety) of the certificate or key data in the record identified by
info. Data may be provided in multiple calls, in which case the implementation should append each chunk to the existing record until the final chunk is received.When
last_chunkis true, the implementation should finalize the storage process and make the record ready for use.Note
In case of any error during the storage process, Anjay will always call anj_crypto_storage_delete_record.
Note
Only one security record can be created at a time.
- Parameters:
crypto_ctx – Cryptographic context.
info – Identifier of the target security record.
data – Pointer to the data to store.
data_size – Size of the provided data chunk in bytes.
last_chunk – True if this is the final data chunk.
- Returns:
0 on success, or a negative value on failure.