Skip to content

Commit b93af7b

Browse files
authored
Merge pull request #137 from ARMmbed/devkey
Add explicit root of trust generation
2 parents 6d64213 + 9fb997a commit b93af7b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// ----------------------------------------------------------------------------
1818
#ifndef MBED_TEST_MODE
1919
#include "mbed.h"
20+
#include "DeviceKey.h"
2021
#include "kv_config.h"
2122
#include "mbed-cloud-client/MbedCloudClient.h" // Required for new MbedCloudClient()
2223
#include "factory_configurator_client.h" // Required for fcc_* functions and FCC_* defines
@@ -165,6 +166,12 @@ int main(void)
165166
return -1;
166167
}
167168

169+
#if MBED_MAJOR_VERSION > 5
170+
// Initialize root of trust
171+
DeviceKey &devkey = DeviceKey::get_instance();
172+
devkey.generate_root_of_trust();
173+
#endif
174+
168175
// Connect with NetworkInterface
169176
printf("Connect to network\n");
170177
network = NetworkInterface::get_default_instance();

0 commit comments

Comments
 (0)