![]() |
Wirepas SDK
|
The secure storage library provides the APIs for protecting the content of application persistent data on internal or external flash. The content of the persistent memory area is encrypted and authenticated with secret device specific security keys.
The application should use the APIs to store or retrieve the application specific sensitive data. The same APIs can also be used to store and retrieve the non-sensitive data, then it won't be encrypted and authenticated but stored as plain text.
Definition in file app_secure_storage.h.
Go to the source code of this file.
Functions | |
app_secure_storage_res_e | App_SecureStorage_init (uint32_t area_id) |
Initialize secure storage area. More... | |
app_secure_storage_res_e | App_SecureStorage_erase (uint32_t area_id) |
Erase secure storage area. More... | |
app_secure_storage_res_e | App_SecureStorage_check (uint32_t area_id) |
Check if secure storage area exists. More... | |
app_secure_storage_res_e | App_SecureStorage_read (uint32_t area_id, uint32_t tag, uint8_t *data, size_t *max_amount) |
Read data from the secure storage area. More... | |
app_secure_storage_res_e | App_SecureStorage_write (uint32_t area_id, uint32_t tag, const uint8_t *data, size_t len, app_secure_storage_flags_e flags) |
Write data to the secure storage area. More... | |
app_secure_storage_res_e | App_SecureStorage_delete (uint32_t area_id, uint32_t tag) |
Delete data from the secure storage area. More... | |
Enumerations | |
enum | app_secure_storage_res_e { APP_SECURE_STORAGE_RES_OK = 0, APP_SECURE_STORAGE_RES_ERROR = 1, APP_SECURE_STORAGE_RES_BUSY = 2, APP_SECURE_STORAGE_RES_NODRIVER = 3, APP_SECURE_STORAGE_RES_PARAM = 4, APP_SECURE_STORAGE_RES_INVALID_AREA = 5, APP_SECURE_STORAGE_RES_INVALID_TAG = 6 } |
List of return code. More... | |
enum | app_secure_storage_flags_e { APP_SECURE_STORAGE_NO_ENCRYPT = (1 << 0), APP_SECURE_STORAGE_NO_AUTH = (1 << 1) } |
Secure storage option flags. More... | |
app_secure_storage_res_e App_SecureStorage_check | ( | uint32_t | area_id | ) |
Check if secure storage area exists.
area_id | ID of the memory area to check. |
app_secure_storage_res_e App_SecureStorage_delete | ( | uint32_t | area_id, |
uint32_t | tag | ||
) |
Delete data from the secure storage area.
area_id | ID of the secure storage memory area to write |
tag | ID of the data to delete. |
app_secure_storage_res_e App_SecureStorage_erase | ( | uint32_t | area_id | ) |
Erase secure storage area.
area_id | ID of the memory area to erase. |
app_secure_storage_res_e App_SecureStorage_init | ( | uint32_t | area_id | ) |
Initialize secure storage area.
area_id | ID of the memory area to initialize as secure storage area. |
app_secure_storage_res_e App_SecureStorage_read | ( | uint32_t | area_id, |
uint32_t | tag, | ||
uint8_t * | data, | ||
size_t * | max_amount | ||
) |
Read data from the secure storage area.
area_id | ID of the secure storage memory area to write |
tag | ID of the data to read. |
data | Pointer to store read data |
max_amount | Number of bytes of space available for reading, actual number of bytes read returned |
app_secure_storage_res_e App_SecureStorage_write | ( | uint32_t | area_id, |
uint32_t | tag, | ||
const uint8_t * | data, | ||
size_t | len, | ||
app_secure_storage_flags_e | flags | ||
) |
Write data to the secure storage area.
area_id | ID of the secure storage memory area to write |
tag | ID of the data to write. |
data | Pointer to the data to write |
len | Length of data to write |
Secure storage option flags.
Enumerator | |
---|---|
APP_SECURE_STORAGE_NO_ENCRYPT | Do not encrypt data |
APP_SECURE_STORAGE_NO_AUTH | Do not authenticate data |
Definition at line 51 of file app_secure_storage.h.
List of return code.
Definition at line 31 of file app_secure_storage.h.