Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
internal_trusted_storage.h File Reference

The PSA Internal Trusted Storage (ITS) API. More...

Go to the source code of this file.

Macros

#define PSA_ITS_API_VERSION_MAJOR   1
 
#define PSA_ITS_API_VERSION_MINOR   0
 

Functions

psa_status_t psa_its_set (psa_storage_uid_t uid, size_t data_length, const void *p_data, psa_storage_create_flags_t create_flags)
 Creates a new or modifies an existing entry.
 
psa_status_t psa_its_get (psa_storage_uid_t uid, size_t data_offset, size_t data_size, void *p_data, size_t *p_data_length)
 Retrieves data associated with the provided uid.
 
psa_status_t psa_its_get_info (psa_storage_uid_t uid, struct psa_storage_info_t *p_info)
 Retrieves the metadata of a given entry.
 
psa_status_t psa_its_remove (psa_storage_uid_t uid)
 Removes the provided uid and its associated data.
 

Detailed Description

The PSA Internal Trusted Storage (ITS) API.

For more information on the ITS, see The Internal Trusted Storage API.

Macro Definition Documentation

◆ PSA_ITS_API_VERSION_MAJOR

#define PSA_ITS_API_VERSION_MAJOR   1

◆ PSA_ITS_API_VERSION_MINOR

#define PSA_ITS_API_VERSION_MINOR   0

Function Documentation

◆ psa_its_get()

psa_status_t psa_its_get ( psa_storage_uid_t uid,
size_t data_offset,
size_t data_size,
void * p_data,
size_t * p_data_length )

Retrieves data associated with the provided uid.

Parameters
[in]uidThe identifier of the data.
[in]data_offsetThe offset, in bytes, from which to start reading the data.
[in]data_sizeThe number of bytes to read.
[out]p_dataThe buffer where the data will be placed on success. Must be at least data_size bytes long.
[out]p_data_lengthOn success, the number of bytes placed in p_data.
Return values
PSA_SUCCESSThe operation completed successfully.
PSA_ERROR_INVALID_ARGUMENTOne or more of the arguments are invalid. This can also happen if data_offset is larger than the size of the data associated with uid.
PSA_ERROR_DOES_NOT_EXISTThe provided uid was not found in the storage.
PSA_ERROR_STORAGE_FAILUREThe physical storage has failed (fatal error).

◆ psa_its_get_info()

psa_status_t psa_its_get_info ( psa_storage_uid_t uid,
struct psa_storage_info_t * p_info )

Retrieves the metadata of a given entry.

Parameters
[in]uidThe identifier of the entry.
[out]p_infoA pointer to a psa_storage_info_t struct that will be populated with the metadata on success.
Return values
PSA_SUCCESSThe operation completed successfully.
PSA_ERROR_INVALID_ARGUMENTOne or more of the arguments are invalid.
PSA_ERROR_DOES_NOT_EXISTThe provided uid was not found in the storage.
PSA_ERROR_STORAGE_FAILUREThe physical storage has failed (fatal error).

◆ psa_its_remove()

psa_status_t psa_its_remove ( psa_storage_uid_t uid)

Removes the provided uid and its associated data.

Deletes all the data associated with the entry from internal storage.

Parameters
uidThe identifier of the entry to remove.
Return values
PSA_SUCCESSThe operation completed successfully.
PSA_ERROR_NOT_PERMITTEDThe entry was created with PSA_STORAGE_FLAG_WRITE_ONCE.
PSA_ERROR_INVALID_ARGUMENTuid is invalid.
PSA_ERROR_DOES_NOT_EXISTThe provided uid was not found in the storage.
PSA_ERROR_STORAGE_FAILUREThe physical storage has failed (fatal error).

◆ psa_its_set()

psa_status_t psa_its_set ( psa_storage_uid_t uid,
size_t data_length,
const void * p_data,
psa_storage_create_flags_t create_flags )

Creates a new or modifies an existing entry.

Stores data in the internal storage.

Parameters
uidThe identifier of the data. Must be nonzero.
data_lengthThe size in bytes of the data in p_data to store.
p_dataA buffer containing the data to store.
create_flagsFlags indicating the properties of the entry.
Return values
PSA_SUCCESSThe operation completed successfully.
PSA_ERROR_NOT_PERMITTEDAn entry associated with the provided uid already exists and was created with PSA_STORAGE_FLAG_WRITE_ONCE.
PSA_ERROR_NOT_SUPPORTEDOne or more of the flags provided in create_flags are not supported or invalid.
PSA_ERROR_INVALID_ARGUMENTOne or more arguments other than create_flags are invalid.
PSA_ERROR_INSUFFICIENT_STORAGEThere is insufficient space on the storage medium.
PSA_ERROR_STORAGE_FAILUREThe physical storage has failed (fatal error).