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-dps/quick-create-simulated-device-symm-key.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,16 @@ services: iot-dps
10
10
manager: lizross
11
11
ms.custom: mvc, mode-other
12
12
zone_pivot_groups: iot-dps-set1
13
-
#Customer intent: As a new IoT developer, I want to connect a device to an IoT Hub using the SDK, to learn how secure provisioning works with symmetric keys.
13
+
#Customer intent: As a new IoT developer, I want to connect a device to an IoT hub using the SDK, to learn how secure provisioning works with symmetric keys.
14
14
---
15
15
16
16
# Quickstart: Provision a simulated symmetric key device
17
17
18
-
In this quickstart, you'll create a simulated device on your Windows machine. The simulated device will be configured to use the [symmetric key attestation](concepts-symmetric-key-attestation.md) mechanism for authentication. After you've configured your device, you'll then provision it to your IoT hub using the Azure IoT Hub Device Provisioning Service.
18
+
In this quickstart, you create a simulated device on your Windows machine. The simulated device is configured to use the [symmetric key attestation](concepts-symmetric-key-attestation.md) mechanism for authentication. After you've configured your device, you then provision it to your IoT hub using the Azure IoT Hub Device Provisioning Service.
19
19
20
20
If you're unfamiliar with the process of provisioning, review the [provisioning](about-iot-dps.md#provisioning-process) overview.
21
21
22
-
This quickstart demonstrates a solution for a Windows-based workstation. However, you can also perform the procedures on Linux. For a Linux example, see [Tutorial: provision for geolatency](how-to-provision-multitenant.md).
22
+
This quickstart demonstrates a solution for a Windows-based workstation. However, you can also perform the procedures on Linux. For a Linux example, see [Tutorial: provision for geo latency](how-to-provision-multitenant.md).
23
23
24
24
## Prerequisites
25
25
@@ -253,7 +253,7 @@ To update and run the provisioning sample with your device information:
253
253
static const char* id_scope = "0ne00002193";
254
254
```
255
255
256
-
6. Find the definition for the `main()` function in the same file. Make sure the `hsm_type` variable is set to `SECURE_DEVICE_TYPE_SYMMETRIC_KEY` as shown below:
256
+
6. Find the definition for the `main()` function in the same file. Make sure the `hsm_type` variable is set to `SECURE_DEVICE_TYPE_SYMMETRIC_KEY` as shown in the following example:
257
257
258
258
```c
259
259
SECURE_DEVICE_TYPE hsm_type;
@@ -327,7 +327,7 @@ To update and run the provisioning sample with your device information:
327
327
cd '.\azure-iot-sdk-csharp\provisioning\device\samples\how to guides\SymmetricKeySample\'
328
328
```
329
329
330
-
4. In the *SymmetricKeySample* folder, open *Parameters.cs* in a text editor. This file shows the parameters that are supported by the sample. Only the first three required parameters are used in this article when running the sample. Review the code in this file. No changes are needed.
330
+
4. In the *SymmetricKeySample* folder, open *Parameters.cs* in a text editor. This file shows the available parameters for the sample. Only the first three required parameters are used in this article when running the sample. Review the code in this file. No changes are needed.
You may comment out this code, as it is not needed with for this quick start. A custom payload would be required you wanted to use a custom allocation function to assign your device to an IoT Hub. For more information, see [Tutorial: Use custom allocation policies](tutorial-custom-allocation-policies.md).
405
+
You may comment out this code, as it's not needed with for this quickstart. A custom payload would be required you wanted to use a custom allocation function to assign your device to an IoT hub. For more information, see [Tutorial: Use custom allocation policies](tutorial-custom-allocation-policies.md).
406
406
407
407
The `provisioningClient.register()` method attempts the registration of your device.
408
408
@@ -573,7 +573,7 @@ To update and run the provisioning sample with your device information:
573
573
574
574
1. In the main menu of your Device Provisioning Service, select **Overview**.
575
575
576
-
2. Copy the **ID Scope** and **Global device endpoint** values. These are your `SCOPE_ID` and `GLOBAL_ENDPOINT` respectively.
576
+
2. Copy the **ID Scope** and **Global device endpoint** values. These values are your `SCOPE_ID` and `GLOBAL_ENDPOINT` parameters, respectively.
577
577
578
578
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-id-scope-and-global-device-endpoint.png" alt-text="Extract Device Provisioning Service endpoint information":::
# Quickstart: Provision an X.509 certificate simulated device
17
17
18
-
In this quickstart, you'll create a simulated device on your Windows machine. The simulated device will be configured to use the [X.509 certificate attestation](concepts-x509-attestation.md) mechanism for authentication. After you've configured your device, you'll then provision it to your IoT hub using the Azure IoT Hub Device Provisioning Service.
18
+
In this quickstart, you create a simulated device on your Windows machine. The simulated device is configured to use the [X.509 certificate attestation](concepts-x509-attestation.md) mechanism for authentication. After you've configured your device, you then provision it to your IoT hub using the Azure IoT Hub Device Provisioning Service.
19
19
20
20
If you're unfamiliar with the process of provisioning, review the [provisioning](about-iot-dps.md#provisioning-process) overview. Also make sure you've completed the steps in [Set up IoT Hub Device Provisioning Service with the Azure portal](./quick-setup-auto-provision.md) before continuing.
21
21
22
-
This quickstart demonstrates a solution for a Windows-based workstation. However, you can also perform the procedures on Linux. For a Linux example, see [Tutorial: Provision for geolatency](how-to-provision-multitenant.md).
22
+
This quickstart demonstrates a solution for a Windows-based workstation. However, you can also perform the procedures on Linux. For a Linux example, see [Tutorial: Provision for geo latency](how-to-provision-multitenant.md).
23
23
24
24
## Prerequisites
25
25
@@ -87,13 +87,13 @@ The following prerequisites are for a Windows development environment. For Linux
87
87
88
88
* Open both a Windows command prompt and a Git Bash prompt.
89
89
90
-
The steps in this quickstart assume that you're using a Windows machine and the OpenSSL installation that is installed as part of Git. You'll use the Git Bash prompt to issue OpenSSL commands and the Windows command prompt for everything else. If you're using Linux, you can issue all commands from a Bash shell.
90
+
The steps in this quickstart assume that you're using a Windows machine and the OpenSSL installation that is installed as part of Git. You use the Git Bash prompt to issue OpenSSL commands and the Windows command prompt for everything else. If you're using Linux, you can issue all commands from a Bash shell.
91
91
92
92
## Prepare your development environment
93
93
94
94
::: zone pivot="programming-language-ansi-c"
95
95
96
-
In this section, you'll prepare a development environment that's used to build the [Azure IoT C SDK](https://github.com/Azure/azure-iot-sdk-c). The sample code attempts to provision the device, during the device's boot sequence.
96
+
In this section, you prepare a development environment that's used to build the [Azure IoT C SDK](https://github.com/Azure/azure-iot-sdk-c). The sample code attempts to provision the device, during the device's boot sequence.
97
97
98
98
1. Open a web browser, and go to the [Release page of the Azure IoT C SDK](https://github.com/Azure/azure-iot-sdk-c/releases/latest).
In this section, you'll use OpenSSL to create a self-signed X.509 certificate and a private key. This certificate will be uploaded to your provisioning service instance and verified by the service.
202
+
In this section, you use OpenSSL to create a self-signed X.509 certificate and a private key. This certificate is uploaded to your provisioning service instance and verified by the service.
203
203
204
204
> [!CAUTION]
205
205
> Use certificates created with OpenSSL in this quickstart for development testing only.
@@ -318,13 +318,13 @@ Perform the steps in this section in your Git Bash prompt.
318
318
319
319
7. When asked to **Enter pass phrase for device-key.pem:**, use the same pass phrase you did previously, `1234`.
320
320
321
-
Keep the Git Bash prompt open. You'll need it later in this quickstart.
321
+
Keep the Git Bash prompt open. You need it later in this quickstart.
322
322
323
323
::: zone-end
324
324
325
325
::: zone pivot="programming-language-csharp"
326
326
327
-
The C# sample code is set up to use X.509 certificates that are stored in a password-protected PKCS#12 formatted file (`certificate.pfx`). You'll still need the PEM formatted public key certificate file (`device-cert.pem`) that you just created to create an individual enrollment entry later in this quickstart.
327
+
The C# sample code is set up to use X.509 certificates that are stored in a password-protected PKCS#12 formatted file (`certificate.pfx`). You still need the PEM formatted public key certificate file (`device-cert.pem`) that you just created to create an individual enrollment entry later in this quickstart.
328
328
329
329
1. To generate the PKCS12 formatted file expected by the sample, enter the following command:
330
330
@@ -356,7 +356,7 @@ The C# sample code is set up to use X.509 certificates that are stored in a pass
You won't need the Git Bash prompt forthe rest of this quickstart. However, you may want to keep it open to check your certificate if you have problemsin later steps.
359
+
You don't need the Git Bash prompt forthe rest of this quickstart. However, you may want to keep it open to check your certificate if you have problemsin later steps.
360
360
361
361
::: zone-end
362
362
@@ -387,7 +387,7 @@ You won't need the Git Bash prompt for the rest of this quickstart. However, you
You won't need the Git Bash prompt forthe rest of this quickstart. However, you may want to keep it open to check your certificate if you have problemsin later steps.
390
+
You don't need the Git Bash prompt forthe rest of this quickstart. However, you may want to keep it open to check your certificate if you have problemsin later steps.
391
391
392
392
::: zone-end
393
393
@@ -400,7 +400,7 @@ You won't need the Git Bash prompt for the rest of this quickstart. However, you
You won't need the Git Bash prompt for the rest of this quickstart. However, you may want to keep it open to check your certificate if you have problems in later steps.
403
+
You don't need the Git Bash prompt for the rest of this quickstart. However, you may want to keep it open to check your certificate if you have problems in later steps.
404
404
405
405
::: zone-end
406
406
::: zone pivot="programming-language-java"
@@ -423,7 +423,7 @@ You won't need the Git Bash prompt for the rest of this quickstart. However, you
423
423
424
424
7. When asked to **Enter pass phrase for device-key.pem:**, use the same pass phrase you did previously, `1234`.
425
425
426
-
Keep the Git Bash prompt open. You'll need it later in this quickstart.
426
+
Keep the Git Bash prompt open. You need it later in this quickstart.
427
427
428
428
::: zone-end
429
429
@@ -482,7 +482,7 @@ In this section, you update the sample code with your Device Provisioning Servic
482
482
483
483
### Configure the custom HSM stub code
484
484
485
-
The specifics of interacting with actual secure hardware-based storage vary depending on the hardware. As a result, the certificate and private key used by the simulated device in this quickstart will be hardcoded in the custom Hardware Security Module (HSM) stub code.
485
+
The specifics of interacting with actual secure hardware-based storage vary depending on the hardware. As a result, the certificate and private key used by the simulated device in this quickstart is hardcoded in the custom Hardware Security Module (HSM) stub code.
486
486
487
487
To update the custom HSM stub code to simulate the identity of the device with ID `my-x509-device`:
488
488
@@ -506,7 +506,7 @@ To update the custom HSM stub code to simulate the identity of the device with I
506
506
"-----END CERTIFICATE-----";
507
507
```
508
508
509
-
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This commandwill generate the syntax for the `CERTIFICATE` string constant value and write it to the output.
509
+
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This command generates the syntax for the `CERTIFICATE` string constant value and writes it to the output.
510
510
511
511
```Bash
512
512
sed -e 's/^/"/;$ !s/$/""\\n"/;$ s/$/"/' device-cert.pem
@@ -526,7 +526,7 @@ To update the custom HSM stub code to simulate the identity of the device with I
526
526
"-----END RSA PRIVATE KEY-----";
527
527
```
528
528
529
-
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This commandwill generate the syntax for the `PRIVATE_KEY` string constant value and write it to the output.
529
+
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This commandgenerates the syntax for the `PRIVATE_KEY` string constant value and writes it to the output.
530
530
531
531
```Bash
532
532
sed -e 's/^/"/;$ !s/$/""\\n"/;$ s/$/"/' unencrypted-device-key.pem
@@ -563,7 +563,7 @@ To update the custom HSM stub code to simulate the identity of the device with I
563
563
564
564
::: zone pivot="programming-language-csharp"
565
565
566
-
In this section, you'll use your Windows command prompt.
566
+
In this section, you use your Windows command prompt.
567
567
568
568
1. In the Azure portal, selectthe**Overview** tab for your Device Provisioning Service.
569
569
@@ -573,7 +573,7 @@ In this section, you'll use your Windows command prompt.
573
573
574
574
3. In your Windows command prompt, change to the X509Sample directory. This directory is located in the *.\azure-iot-sdk-csharp\provisioning\device\samples\getting started\X509Sample* directory off the directory where you cloned the samples on your computer.
575
575
576
-
4. Enter the following command to build and run the X.509 device provisioning sample (replace the `<IDScope>` value with the ID Scope that you copied in the previous section. The certificate file will default to *./certificate.pfx* and promptfor the .pfx password.
576
+
4. Enter the following command to build and run the X.509 device provisioning sample (replace the `<IDScope>` value with the ID Scope that you copied in the previous section. The certificate file defaults to *./certificate.pfx* and promptsfor the .pfx password.
577
577
578
578
```cmd
579
579
dotnet run -- -s <IDScope>
@@ -588,7 +588,7 @@ In this section, you'll use your Windows command prompt.
588
588
dotnet run -- -s 0ne00000A0A -c certificate.pfx -p 1234
589
589
```
590
590
591
-
5. The device connects to DPS and is assigned to an IoT hub. Then, the device will send a telemetry message to the IoT hub.
591
+
5. The device connects to DPS and is assigned to an IoT hub. Then, the device sends a telemetry message to the IoT hub.
592
592
593
593
```output
594
594
Loading the certificate...
@@ -611,7 +611,7 @@ In this section, you'll use your Windows command prompt.
611
611
612
612
::: zone pivot="programming-language-nodejs"
613
613
614
-
In this section, you'll use your Windows command prompt.
614
+
In this section, you use your Windows command prompt.
615
615
616
616
1. In the Azure portal, selectthe**Overview** tab for your Device Provisioning Service.
617
617
@@ -676,7 +676,7 @@ In this section, you'll use your Windows command prompt.
676
676
677
677
::: zone pivot="programming-language-python"
678
678
679
-
In this section, you'll use your Windows command prompt.
679
+
In this section, you use your Windows command prompt.
680
680
681
681
1. In the Azure portal, selectthe**Overview** tab for your Device Provisioning Service.
682
682
@@ -724,7 +724,7 @@ In this section, you'll use your Windows command prompt.
724
724
725
725
1. Review the code for [provision_x509.py](https://github.com/Azure/azure-iot-sdk-python/blob/v2/samples/async-hub-scenarios/provision_x509.py). If you're not using **Python version 3.7** or later, make the [code change mentioned here](https://github.com/Azure/azure-iot-sdk-python/tree/v2/samples/async-hub-scenarios#advanced-iot-hub-scenario-samples-for-the-azure-iot-hub-device-sdk) to replace `asyncio.run(main())` and save your changes.
726
726
727
-
1. Run the sample. The sample connects to DPS, which will provision the device to an IoT hub. After the device is provisioned, the sample will send some test messages to the IoT hub.
727
+
1. Run the sample. The sample connects to DPS, which provisions the device to an IoT hub. After the device is provisioned, the sample sends some test messages to the IoT hub.
@@ -798,7 +798,7 @@ In this section, you use both your Windows command prompt and your Git Bash prom
798
798
"-----END CERTIFICATE-----";
799
799
```
800
800
801
-
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This command will generate the syntax for the `leafPublicPem` string constant value and write it to the output.
801
+
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This command generates the syntax for the `leafPublicPem` string constant value and write it to the output.
802
802
803
803
```Bash
804
804
sed 's/^/"/;$ !s/$/\\n" +/;$ s/$/"/' device-cert.pem
@@ -818,7 +818,7 @@ In this section, you use both your Windows command prompt and your Git Bash prom
818
818
"-----END PRIVATE KEY-----";
819
819
```
820
820
821
-
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This commandwill generate the syntax for the `leafPrivateKey` string constant value and write it to the output.
821
+
Updating this string value manually can be prone to error. To generate the proper syntax, you can copy and paste the following command into your **Git Bash prompt**, and press **ENTER**. This commandgenerates the syntax for the `leafPrivateKey` string constant value and write it to the output.
822
822
823
823
```Bash
824
824
sed 's/^/"/;$ !s/$/\\n" +/;$ s/$/"/' unencrypted-device-key.pem
@@ -841,7 +841,7 @@ In this section, you use both your Windows command prompt and your Git Bash prom
The sample connects to DPS, which will provision the device to an IoT hub. After the device is provisioned, the sample will send some test messages to the IoT hub.
844
+
The sample connects to DPS, which provisions the device to an IoT hub. After the device is provisioned, the sample sends some test messages to the IoT hub.
0 commit comments