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
Copy file name to clipboardExpand all lines: articles/iot-edge/how-to-create-test-certificates.md
+5-60Lines changed: 5 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Create test certificates and learn how to install them on an Azure
4
4
author: kgremban
5
5
manager: philmea
6
6
ms.author: kgremban
7
-
ms.date: 02/26/2020
7
+
ms.date: 12/07/2019
8
8
ms.topic: conceptual
9
9
ms.service: iot-edge
10
10
services: iot-edge
@@ -22,15 +22,6 @@ You can create certificates on any machine, and then copy them over to your IoT
22
22
It's easier to use your primary machine to create the certificates rather than generating them on your IoT Edge device itself.
23
23
By using your primary machine, you can set up the scripts once and then repeat the process to create certificates for multiple devices.
24
24
25
-
Follow these steps to create demo certificates for testing your IoT Edge scenario:
26
-
27
-
1.[Set up scripts](#set-up-scripts) for certificate generation on your device.
28
-
2.[Create the root CA certificate](#create-root-ca-certificate) that you use to sign all the other certificates for your scenario.
29
-
3. Generate the certificates you need for the scenario you want to test:
30
-
*[Create IoT Edge device identity certificates](#create-iot-edge-device-identity-certificates) to test automatic provisioning with the IoT Hub Device Provisioning Service.
31
-
*[Create IoT Edge device CA certificates](#create-iot-edge-device-ca-certificates) to test production scenarios or gateway scenarios.
32
-
*[Create downstream device certificates](#create-downstream-device-certificates) to test authenticating downstream devices to IoT Hub in a gateway scenario.
33
-
34
25
## Prerequisites
35
26
36
27
A development machine with Git installed.
@@ -178,11 +169,7 @@ Before proceeding with the steps in this section, follow the steps in the [Set u
178
169
179
170
## Create IoT Edge device CA certificates
180
171
181
-
Every IoT Edge device going to production needs a device CA certificate that's referenced from the config.yaml file.
182
-
The device CA certificate is responsible for creating certificates for modules running on the device.
183
-
It's also how the IoT Edge device verifies its identity when connecting to downstream devices.
184
-
185
-
Device CA certificates go in the **Certificate** section of the config.yaml file on the IoT Edge device.
172
+
Every IoT Edge device going to production needs a device CA certificate that's referenced from the config.yaml file. The device CA certificate is responsible for creating certificates for modules running on the device. It's also how the IoT Edge device verifies its identity when connecting to downstream devices.
186
173
187
174
Before proceeding with the steps in this section, follow the steps in the [Set up scripts](#set-up-scripts) and [Create root CA certificate](#create-root-ca-certificate) sections.
188
175
@@ -201,9 +188,7 @@ Before proceeding with the steps in this section, follow the steps in the [Set u
The gateway device name passed into those scripts should not be the same as the "hostname" parameter in config.yaml, or the device's ID in IoT Hub.
205
-
The scripts help you avoid any issues by appending a ".ca" string to the gateway device name to prevent the name collision in case a user sets up IoT Edge using the same name in both places.
206
-
However, it's good practice to avoid using the same name.
191
+
The gateway device name passed into those scripts should not be the same as the "hostname" parameter in config.yaml. The scripts help you avoid any issues by appending a ".ca" string to the gateway device name to prevent the name collision in case a user sets up IoT Edge using the same name in both places. However, it's good practice to avoid using the same name.
207
192
208
193
### Linux
209
194
@@ -220,49 +205,9 @@ However, it's good practice to avoid using the same name.
The gateway device name passed into those scripts should not be the same as the "hostname" parameter in config.yaml, or the device's ID in IoT Hub.
224
-
The scripts help you avoid any issues by appending a ".ca" string to the gateway device name to prevent the name collision in case a user sets up IoT Edge using the same name in both places.
225
-
However, it's good practice to avoid using the same name.
226
-
227
-
## Create IoT Edge device identity certificates
228
-
229
-
Device identity certificates are used to provision IoT Edge devices through the [Azure IoT Hub Device Provisioning Service (DPS)](../iot-dps/index.yml).
230
-
231
-
Device identity certificates go in the **Provisioning** section of the config.yaml file on the IoT Edge device.
232
-
233
-
Before proceeding with the steps in this section, follow the steps in the [Set up scripts](#set-up-scripts) and [Create root CA certificate](#create-root-ca-certificate) sections.
234
-
235
-
### Windows
236
-
237
-
Create the IoT Edge device identity certificate and private key with the following command:
238
-
239
-
```powershell
240
-
New-CACertsEdgeDeviceIdentity "<name>"
241
-
```
242
-
243
-
The name that you pass in to this command will be the device ID for the IoT Edge device in IoT Hub.
244
-
245
-
The new device identity command creates several certificate and key files, including two that you'll use when creating an individual enrollment in DPS and installing the IoT Edge runtime:
The name that you pass in to this command will be the device ID for the IoT Edge device in IoT Hub.
259
-
260
-
The script creates several certificate and key files, including two that you'll use when creating an individual enrollment in DPS and installing the IoT Edge runtime:
The gateway device name passed into those scripts should not be the same as the "hostname" parameter in config.yaml. The scripts help you avoid any issues by appending a ".ca" string to the gateway device name to prevent the name collision in case a user sets up IoT Edge using the same name in both places. However, it's good practice to avoid using the same name.
264
209
265
-
## Create downstream device certificates
210
+
## Create X.509 certs for downstream devices
266
211
267
212
If you're setting up a downstream IoT device for a gateway scenario, you can generate demo certificates for X.509 authentication.
268
213
There are two ways to authenticate an IoT device using X.509 certificates: using self-signed certs or using certificate authority (CA) signed certs.
Find the provisioning configurations of the file and uncomment the **Manual provisioning configuration** section. Update the value of **device_connection_string** with the connection string from your IoT Edge device. Make sure any other provisioning sections are commented out. Make sure the **provisioning:** line has no preceding whitespace and that nested items are indented by two spaces.
IoT Edge devices can be automatically provisioned using the [Azure IoT Hub Device Provisioning Service (DPS)](../iot-dps/index.yml). Currently, IoT Edge supports two attestation mechanisms when using automatic provisioning, but your hardware requirements may impact your choices. For example, Raspberry Pi devices do not come with a Trusted Platform Module (TPM) chip by default. For more information, refer to the following articles:
200
-
201
-
* [Create and provision an IoT Edge device with a virtual TPM on a Linux VM](how-to-auto-provision-simulated-device-linux.md)
202
-
* [Create and provision an IoT Edge device using X.509 certificates](how-to-auto-provision-x509-certs.md)
203
-
* [Create and provision an IoT Edge device using symmetric key attestation](how-to-auto-provision-symmetric-keys.md)
204
-
205
-
Those articles walk you through setting up enrollments in DPS, and generating the proper certificates or keys for attestation. Regardless of which attestation mechanism you choose, the provisioning information is added to the IoT Edge configuration file on your IoT Edge device.
207
+
To automatically provision a device, [set up Device Provisioning Service and retrieve your device registration ID](how-to-auto-provision-simulated-device-linux.md). There are a number of attestation mechanisms supported by IoT Edge when using automatic provisioning but your hardware requirements also impact your choices. For example, Raspberry Pi devices do not come with a Trusted Platform Module (TPM) chip by default.
206
208
207
209
Open the configuration file.
208
210
209
211
```bash
210
212
sudo nano /etc/iotedge/config.yaml
211
213
```
212
214
213
-
Find the provisioning configurations of the file and uncomment the section appropriate for your attestation mechanism. Make sure any other provisioning sections are commented out. The **provisioning:** line should have no preceding whitespace, and nested items should be indented by two spaces. Update the value of **scope_id** with the value from your IoT Hub Device Provisioning Service instance, and provide the appropriate values for the attestation fields.
# registration_id: "<OPTIONAL REGISTRATION ID. IF UNSPECIFIED CAN BE OBTAINED FROM CN OF identity_cert"
239
-
identity_cert: "<REQUIRED URI TO DEVICE IDENTITY CERTIFICATE>"
240
-
identity_pk: "<REQUIRED URI TO DEVICE IDENTITY PRIVATE KEY>"
241
-
```
215
+
Find the provisioning configurations of the file and uncomment the section appropriate for your attestation mechanism. When using TPM attestation, for example, update the values of **scope_id** and **registration_id** with the values from your IoT Hub Device Provisioning service and your IoT Edge device with TPM, respectively. Make sure the **provisioning:** line has no preceding whitespace and that nested items are indented by two spaces.
0 commit comments