Skip to content

Commit

Permalink
Generate DeviceKey Root of Trust if TDB_EXTERNAL is used
Browse files Browse the repository at this point in the history
TDB_INTERNAL is based on SecureStore which uses DeviceKey.
  • Loading branch information
LDong-Arm committed Nov 26, 2020
1 parent 3ae1656 commit 701fb5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <string.h>
#include "KVStore.h"
#include "kvstore_global_api.h"
#include "SecureStore.h"

using namespace mbed;

Expand Down Expand Up @@ -59,6 +60,11 @@ void kv_store_global_api_example()
res = kv_reset("/kv/");
printf("kv_reset -> %d\n", err_code(res));

#if MBED_CONF_STORAGE_STORAGE_TYPE == TDB_EXTERNAL
res = DeviceKey::get_instance().generate_root_of_trust();
printf("DeviceKey::get_instance().generate_root_of_trust() -> %d\n", res);
#endif

/* Set First 'Dummy' Key/Value pair with unprotected clear value data */
printf("kv_set first dummy key\n");
res = kv_set(kv_key_in, kv_value_in, strlen(kv_value_in), 0);
Expand Down

0 comments on commit 701fb5d

Please sign in to comment.