Skip to content

Commit e877d81

Browse files
committed
Recommend use of tpm2-tools
1 parent dec4b82 commit e877d81

File tree

1 file changed

+42
-9
lines changed

1 file changed

+42
-9
lines changed

articles/iot-edge/how-to-provision-devices-at-scale-linux-tpm.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,57 @@ After the installation is finished and you've signed back in to your VM, you're
141141

142142
## Retrieve provisioning information for your TPM
143143

144-
In this section, you build a tool that you can use to retrieve the registration ID and endorsement key for your TPM.
144+
In this section, you use the TPM2 software tools to retrieve the endorsement key for your TPM and then generate a unique registration ID.
145145

146-
1. Sign in to your device, and then follow the steps in [Set up a Linux development environment](https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/devbox_setup.md#linux) to install and build the Azure IoT device SDK for C.
146+
1. Sign in to your device, and install the `tpm2-tools` package.
147+
148+
149+
# [Ubuntu](#tab/ubuntu)
150+
151+
152+
```bash
153+
sudo apt-get install tpm2-tools
154+
155+
```
156+
157+
# [Debian](#tab/debian)
158+
159+
160+
```bash
161+
sudo apt-get install tpm2-tools
162+
163+
```
164+
165+
# [Raspberry Pi OS](#tab/rpios)
147166

148-
1. Run the following commands to build the SDK tool that retrieves your device provisioning information for your TPM.
149167

150168
```bash
151-
cd azure-iot-sdk-c/cmake
152-
cmake -Duse_prov_client:BOOL=ON ..
153-
cd provisioning_client/tools/tpm_device_provision
154-
make
155-
sudo ./tpm_device_provision
169+
sudo apt-get install tpm2-tools
170+
171+
```
172+
173+
# [Red Hat Enterprise Linux](#tab/rhel)
174+
175+
176+
```bash
177+
sudo yum install tpm2-tools
178+
179+
```
180+
181+
---
182+
183+
1. Run the following commands to read the endorsement key in your TPM and generate a unique registration ID. This assumes the endorsement key is at the default location of 0x81010001.
184+
185+
```bash
186+
tpm2_readpublic -Q -c 0x81010001 -o ek.pub
187+
printf "Gathering the registration information...\n\nRegistration Id:\n%s\n\nEndorsement Key:\n%s\n" $(sha256sum -b ek.pub | cut -d' ' -f1) $(base64 -w0 ek.pub)
156188
```
157189

158190
1. The output window displays the device's **Registration ID** and the **Endorsement key**. Copy these values for use later when you create an individual enrollment for your device in the device provisioning service.
159191

160192
> [!TIP]
161-
> If you don't want to use the SDK tool to retrieve the information, you need to find another way to obtain the provisioning information. The endorsement key, which is unique to each TPM chip, is obtained from the TPM chip manufacturer associated with it. You can derive a unique registration ID for your TPM device. For example, you can create an SHA-256 hash of the endorsement key.
193+
> If you don't want to use the TPM2 software tools to retrieve the information, you need to find another way to obtain the provisioning information. The endorsement key, which is unique to each TPM chip, is obtained from the TPM chip manufacturer associated with it. You can derive a unique registration ID for your TPM device. For example, you can create an SHA-256 hash of the endorsement key.
194+
162195

163196
After you have your registration ID and endorsement key, you're ready to continue.
164197

0 commit comments

Comments
 (0)