Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
psa_crypto_transaction_t Union Reference
Transaction data. More...
#include <psa_crypto_storage.h>
Detailed Description
Transaction data.
This type is designed to be serialized by writing the memory representation and reading it back on the same device.
- Note:
- The transaction mechanism is designed for a single active transaction at a time. The transaction object is psa_crypto_transaction.
- If an API call starts a transaction, it must complete this transaction before returning to the application.
The lifetime of a transaction is the following (note that only one transaction may be active at a time):
- Call psa_crypto_prepare_transaction() to initialize the transaction object in memory and declare the type of transaction that is starting.
- Fill in the type-specific fields of psa_crypto_transaction.
- Call psa_crypto_save_transaction() to start the transaction. This saves the transaction data to internal storage.
- Perform the work of the transaction by modifying files, contacting external entities, or whatever needs doing. Note that the transaction may be interrupted by a power failure, so you need to have a way recover from interruptions either by undoing what has been done so far or by resuming where you left off.
- If there are intermediate stages in the transaction, update the fields of psa_crypto_transaction and call psa_crypto_save_transaction() again when each stage is reached.
- When the transaction is over, call psa_crypto_stop_transaction() to remove the transaction data in storage and in memory.
If the system crashes while a transaction is in progress, psa_crypto_init() calls psa_crypto_load_transaction() and takes care of completing or rewinding the transaction. This is done in psa_crypto_recover_transaction() in psa_crypto.c. If you add a new type of transaction, be sure to add code for it in psa_crypto_recover_transaction().
Definition at line 271 of file psa_crypto_storage.h.
Generated on Tue Jul 12 2022 13:55:35 by
1.7.2