This file describes the PSA Internal Trusted Storage API.
More...
#include <stddef.h>
#include <stdint.h>
#include "psa/error.h"
#include "psa/storage_common.h"
#include "mbed_toolchain.h"
Go to the source code of this file.
This file describes the PSA Internal Trusted Storage API.
Definition in file psa_prot_internal_storage.h.
◆ PSA_ITS_API_VERSION_MAJOR
#define PSA_ITS_API_VERSION_MAJOR 1 |
The major version number of the PSA ITS API.
It will be incremented on significant updates that may include breaking changes
Definition at line 33 of file psa_prot_internal_storage.h.
◆ PSA_ITS_API_VERSION_MINOR
#define PSA_ITS_API_VERSION_MINOR 1 |
The minor version number of the PSA ITS API.
It will be incremented in small updates that are unlikely to include breaking changes
Definition at line 34 of file psa_prot_internal_storage.h.
◆ psa_its_set()
create a new or modify an existing uid/value pair
- Parameters
-
[in] | uid | the identifier for the data |
[in] | data_length | The size in bytes of the data in p_data |
[in] | p_data | A buffer containing the data |
[in] | create_flags | The flags that the data will be stored with |
- Returns
- A status indicating the success/failure of the operation
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_NOT_PERMITTED | The operation failed because the provided uid value was already created with PSA_STORAGE_WRITE_ONCE_FLAG |
PSA_ERROR_NOT_SUPPORTED | The operation failed because one or more of the flags provided in create_flags is not supported or is not valid |
PSA_ERROR_INSUFFICIENT_STORAGE | The operation failed because there was insufficient space on the storage medium |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (Fatal error) |
PSA_ERROR_INVALID_ARGUMENTS | The operation failed because one of the provided pointers(p_data ) is invalid, for example is NULL or references memory the caller cannot access |
◆ psa_its_get()
Retrieve the value associated with a provided uid.
- Parameters
-
[in] | uid | The uid value |
[in] | data_offset | The starting offset of the data requested |
[in] | data_length | the amount of data requested (and the minimum allocated size of the p_data buffer) |
[out] | p_data | The buffer where the data will be placed upon successful completion |
[out] | p_data_length | The actual amount of data returned |
- Returns
- A status indicating the success/failure of the operation
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_DOES_NOT_EXIST | The operation failed because the provided uid value was not found in the storage |
PSA_ERROR_BUFFER_TOO_SMALL | The operation failed because the data associated with provided uid is not the same size as data_size |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (Fatal error) |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because one of the provided pointers(p_data , p_data_length ) is invalid. For example is NULL or references memory the caller cannot access |
◆ psa_its_get_info()
Retrieve the metadata about the provided uid.
- Parameters
-
[in] | uid | The uid value |
[out] | p_info | A pointer to the psa_storage_info_t struct that will be populated with the metadata |
- Returns
- A status indicating the success/failure of the operation
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_DOES_NOT_EXIST | The operation failed because the provided uid value was not found in the storage |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (Fatal error) |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because one of the provided pointers(p_info ) is invalid, for example is NULL or references memory the caller cannot access |
◆ psa_its_remove()
Remove the provided key and its associated data from the storage.
- Parameters
-
- Returns
- A status indicating the success/failure of the operation
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_DOES_NOT_EXIST | The operation failed because the provided key value was not found in the storage |
PSA_ERROR_NOT_PERMITTED | The operation failed because the provided key value was created with PSA_STORAGE_WRITE_ONCE_FLAG |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (Fatal error) |