You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanclass="images"><span>DeviceKey class hierarchy</span></span>
DeviceKey is a mechanism that implements key derivation from a root of trust key. The DeviceKey mechanism generates symmetric keys that security features need. You can use these keys for encryption, authentication and more. The DeviceKey API allows key derivation without exposing the actual root of trust, to reduce the possibility of accidental exposure of the root of trust outside the device.
6
8
@@ -23,15 +25,15 @@ The root of trust is generated at the first use of DeviceKey if the true random
23
25
24
26
### Key derivation API
25
27
26
-
`generate_derived_key`: This API generates a new key based on an array of data ([salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) the caller provides. A single salt value always generates the same key, so if you need a new key, you must use a new salt value. The salt can be have any value - array, string and so on.
28
+
`generate_derived_key`: This API generates a new key based on an array of data ([salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) the caller provides. A single salt value always generates the same key, so if you need a new key, you must use a new salt value. The salt can have any value - array, string and so on.
27
29
28
30
The generated keys can be 128 or 256 bits in length.
29
31
30
32
#### Root of Trust Injection API
31
33
32
34
`device_inject_root_of_trust`: You must call this API once in the lifecycle of the device, before any call to key derivation, if the device does not support true random number generator (`DEVICE_TRNG` is not defined).
33
35
34
-
#### Using DeviceKey
36
+
#### Using DeviceKey
35
37
36
38
DeviceKey is a singleton class, meaning that the system can have only a single instance of it.
37
39
@@ -45,7 +47,7 @@ To instantiate DeviceKey, you need to call its `get_instance` member function as
45
47
46
48
Run the DeviceKey functionality test with the `mbed` command as following:
47
49
48
-
```
50
+
```
49
51
mbed test -n features-device_key-tests-device_key-functionality
50
52
```
51
53
@@ -55,146 +57,4 @@ Run the DeviceKey functionality test with the `mbed` command as following:
55
57
56
58
### DeviceKey example
57
59
58
-
```
59
-
/*
60
-
* Copyright (c) 2018 ARM Limited. All rights reserved.
61
-
* SPDX-License-Identifier: Apache-2.0
62
-
* Licensed under the Apache License, Version 2.0 (the License); you may
63
-
* not use this file except in compliance with the License.
64
-
* You may obtain a copy of the License at
65
-
*
66
-
* http://www.apache.org/licenses/LICENSE-2.0
67
-
*
68
-
* Unless required by applicable law or agreed to in writing, software
69
-
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
70
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71
-
* See the License for the specific language governing permissions and
0 commit comments