Mbed OS Reference
|
SecureStore class. More...
#include <SecureStore.h>
Public Types | |
typedef struct mbed::KVStore::info | info_t |
Holds key information. More... | |
Public Member Functions | |
SecureStore (KVStore *underlying_kv, KVStore *rbp_kv=0) | |
Class constructor. More... | |
virtual | ~SecureStore () |
Class destructor. More... | |
virtual int | init () |
Initialize SecureStore class. More... | |
virtual int | deinit () |
Deinitialize SecureStore class, free handles and memory allocations. More... | |
virtual int | reset () |
Reset KVStore contents (clear all keys) Warning: This function is not thread safe. More... | |
virtual int | set (const char *key, const void *buffer, size_t size, uint32_t create_flags) |
Set one KVStore item, given key and value. More... | |
virtual int | get (const char *key, void *buffer, size_t buffer_size, size_t *actual_size=NULL, size_t offset=0) |
Get one KVStore item, given key. More... | |
virtual int | get_info (const char *key, info_t *info) |
Get information of a given key. More... | |
virtual int | remove (const char *key) |
Remove a KVStore item, given key. More... | |
virtual int | set_start (set_handle_t *handle, const char *key, size_t final_data_size, uint32_t create_flags) |
Start an incremental KVStore set sequence. More... | |
virtual int | set_add_data (set_handle_t handle, const void *value_data, size_t data_size) |
Add data to incremental KVStore set sequence. More... | |
virtual int | set_finalize (set_handle_t handle) |
Finalize an incremental KVStore set sequence. More... | |
virtual int | iterator_open (iterator_t *it, const char *prefix=NULL) |
Start an iteration over KVStore keys. More... | |
virtual int | iterator_next (iterator_t it, char *key, size_t key_size) |
Get next key in iteration. More... | |
virtual int | iterator_close (iterator_t it) |
Close iteration. More... | |
bool | is_valid_key (const char *key) const |
Convenience function for checking key validity. More... | |
SecureStore class.
SecureStore is a KVStore-based storage solution, providing security features on the stored data, such as encryption, authentication, rollback protection and write once, over an underlying KVStore class. It references an additional KVStore class for storing the rollback protection keys.
Only available if your device has Flash IAP and a hardware entropy source (TRNG).
Definition at line 60 of file SecureStore.h.
|
inherited |
Holds key information.
SecureStore | ( | KVStore * | underlying_kv, |
KVStore * | rbp_kv = 0 |
||
) |
|
virtual |
Class destructor.
|
virtual |
Initialize SecureStore class.
It will also initialize the underlying KVStore and the rollback protection KVStore.
Implements KVStore.
|
virtual |
Deinitialize SecureStore class, free handles and memory allocations.
Implements KVStore.
|
virtual |
|
virtual |
Set one KVStore item, given key and value.
[in] | key | Key - must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
[in] | buffer | Value data buffer. |
[in] | size | Value data size. |
[in] | create_flags | Flag mask - WRITE_ONCE_FLAG|REQUIRE_CONFIDENTIALITY_FLAG| REQUIRE_INTEGRITY_FLAG|REQUIRE_REPLAY_PROTECTION_FLAG |
Implements KVStore.
|
virtual |
Get one KVStore item, given key.
[in] | key | Key - must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
[in] | buffer | Value data buffer. |
[in] | buffer_size | Value data buffer size. |
[out] | actual_size | Actual read size. |
[in] | offset | Offset to read from in data. |
Implements KVStore.
|
virtual |
Get information of a given key.
[in] | key | Key - must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
[out] | info | Returned information structure containing size and flags. |
Implements KVStore.
|
virtual |
Remove a KVStore item, given key.
[in] | key | Key - must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
Implements KVStore.
|
virtual |
Start an incremental KVStore set sequence.
This operation is blocking other operations. Any get/set/remove/iterator operation will be blocked until set_finalize is called.
[out] | handle | Returned incremental set handle. |
[in] | key | Key - must not include '*' '/' '?' ':' ';' '\' '"' '|' ' ' '<' '>' '\'. |
[in] | final_data_size | Final value data size. |
[in] | create_flags | Flag mask - WRITE_ONCE_FLAG|REQUIRE_CONFIDENTIALITY_FLAG| REQUIRE_INTEGRITY_FLAG|REQUIRE_REPLAY_PROTECTION_FLAG |
Implements KVStore.
|
virtual |
Add data to incremental KVStore set sequence.
This operation is blocking other operations. Any get/set/remove operation will be blocked until set_finalize is called.
[in] | handle | Incremental set handle. |
[in] | value_data | value data to add. |
[in] | data_size | value data size. |
Implements KVStore.
|
virtual |
Finalize an incremental KVStore set sequence.
[in] | handle | Incremental set handle. |
Implements KVStore.
|
virtual |
Start an iteration over KVStore keys.
There are no issue with any other operation while iterator is open.
[out] | it | Returned iterator handle. |
[in] | prefix | Key prefix (null for all keys). |
Implements KVStore.
|
virtual |
Get next key in iteration.
There are no issue with any other operation while iterator is open.
[in] | it | Iterator handle. |
[in] | key | Buffer for returned key. |
[in] | key_size | Key buffer size. |
Implements KVStore.
|
virtual |
|
inherited |