Go to the source code of this file.
Legato Secure Storage Admin API
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#define SECSTOREADMIN_MAX_PATH_SIZE 511 |
Maximum number of characters permitted for a secure storage path.
Iterator to list entries in secure storage.
void secStoreAdmin_ConnectService |
( |
void |
| ) |
|
Connect the current client thread to the service providing this API.
This function must be called before any other functions in this API. Normally, it's automatically called for the main thread, but must be explicitly called for other threads. For details, see Client-specific Functions.
This function is created automatically.
Create an iterator for listing entries in secure storage under the specified path.
- Returns
- An iterator reference if successful. NULL if the secure storage is currently unavailable.
- Parameters
-
[in] | path | Path to iterate over. |
Recursively deletes all items under the specified path and the specified path from secure storage.
- Note
- The specified path must be an absolute path.
- Returns
- LE_OK if successful. LE_NOT_FOUND if the path doesn't exist. LE_UNAVAILABLE if the secure storage is currently unavailable. LE_FAULT if there was some other error.
- Parameters
-
[in] | path | Path of the secure storage item. |
Deletes an iterator.
- Parameters
-
[in] | iterRef | Iterator reference. |
void secStoreAdmin_DisconnectService |
( |
void |
| ) |
|
Disconnect the current client thread from the service providing this API.
Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client-specific Functions.
This function is created automatically.
Get the current entry's name.
- Returns
- LE_OK if successful. LE_OVERFLOW if the buffer is too small to hold the entry name. LE_UNAVAILABLE if the secure storage is currently unavailable.
- Parameters
-
[in] | iterRef | Iterator reference. |
[out] | name | Buffer to store the entry name. |
[in] | nameNumElements | |
[out] | isDirPtr | True if the entry is a directory, false otherwise. |
le_result_t secStoreAdmin_GetSize |
( |
const char * |
path, |
|
|
uint64_t * |
sizePtr |
|
) |
| |
Gets the size, in bytes, of all items under the specified path.
- Note
- The specified path must be an absolute path.
- Returns
- LE_OK if successful. LE_NOT_FOUND if the path doesn't exist. LE_UNAVAILABLE if the secure storage is currently unavailable. LE_FAULT if there was some other error.
- Parameters
-
[in] | path | Path of the secure storage item. |
[out] | sizePtr | Size in bytes of all items in the path. |
le_result_t secStoreAdmin_GetTotalSpace |
( |
uint64_t * |
totalSizePtr, |
|
|
uint64_t * |
freeSizePtr |
|
) |
| |
Gets the total space and the available free space in secure storage.
- Returns
- LE_OK if successful. LE_UNAVAILABLE if the secure storage is currently unavailable. LE_FAULT if there was some other error.
- Parameters
-
[out] | totalSizePtr | Total size, in bytes, of secure storage. |
[out] | freeSizePtr | Free space, in bytes, in secure storage. |
Go to the next entry in the iterator. This should be called at least once before accessing the entry. After the first time this function is called successfully on an iterator the first entry will be available.
- Returns
- LE_OK if successful. LE_NOT_FOUND if there are no more entries available.
- Parameters
-
[in] | iterRef | Iterator reference. |
le_result_t secStoreAdmin_Read |
( |
const char * |
path, |
|
|
uint8_t * |
bufPtr, |
|
|
size_t * |
bufNumElementsPtr |
|
) |
| |
Reads an item from secure storage.
- Note
- The specified path must be an absolute path.
- Returns
- LE_OK if successful. LE_OVERFLOW if the buffer is too small to hold the entire item. No data will be written to the buffer in this case. LE_NOT_FOUND if the item doesn't exist. LE_UNAVAILABLE if the secure storage is currently unavailable. LE_FAULT if there was some other error.
- Parameters
-
[in] | path | Path of the secure storage item. |
[out] | bufPtr | Buffer to store the data in. |
[in,out] | bufNumElementsPtr | |
le_result_t secStoreAdmin_Write |
( |
const char * |
path, |
|
|
const uint8_t * |
bufPtr, |
|
|
size_t |
bufNumElements |
|
) |
| |
Writes a buffer of data into the specified path in secure storage. If the item already exists, it'll be overwritten with the new value. If the item doesn't already exist, it'll be created.
- Note
- The specified path must be an absolute path.
- Returns
- LE_OK if successful. LE_NO_MEMORY if there isn't enough memory to store the item. LE_UNAVAILABLE if the secure storage is currently unavailable. LE_FAULT if there was some other error.
- Parameters
-
[in] | path | Path of the secure storage item. |
[in] | bufPtr | Buffer containing the data to store. |
[in] | bufNumElements | |