Skip to content

Commit adf48e1

Browse files
authored
Merge pull request #113525 from dominicbetts/central-x509-snippets
Add X.509 sample code
2 parents 236bad5 + efdb24f commit adf48e1

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.openpublishing.publish.config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@
233233
"url": "https://github.com/Azure-Samples/azure-iot-samples-node",
234234
"branch": "master"
235235
},
236+
{
237+
"path_to_root": "azure-iot-sdk-node",
238+
"url": "https://github.com/Azure/azure-iot-sdk-node",
239+
"branch": "master"
240+
},
236241
{
237242
"path_to_root": "iot-samples-c",
238243
"url": "https://github.com/Azure/azure-iot-sdk-c",

articles/iot-central/core/concepts-get-connected.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ To bulk connect devices using X.509 certificates, first register the devices in
8989

9090
Generate X.509 leaf certificates for your devices using the uploaded root or intermediate certificate. Use the **Device ID** as the `CNAME` value in the leaf certificates. Your device code needs the **ID scope** value for your application, the **device ID**, and the corresponding device certificate.
9191

92+
#### Sample device code
93+
94+
The following sample from the [Azure IoT Node.JS SDK](https://github.com/Azure/azure-iot-sdk-node/blob/master/provisioning/device/samples/register_x509.js) shows how a Node.js device client uses an X.509 leaf certificate and DPS to register with an IoT Central application:
95+
96+
:::code language="nodejs" source="~/azure-iot-sdk-node/provisioning/device/samples/register_x509.js":::
97+
98+
For an equivalent C sample, see [prov_dev_client_sample.c](https://github.com/Azure/azure-iot-sdk-c/blob/master/provisioning_client/samples/prov_dev_client_sample/prov_dev_client_sample.c) in the [Azure IoT C Provisioning Device Client SDK](https://github.com/Azure/azure-iot-sdk-c/blob/master/provisioning_client/devdoc/using_provisioning_client.md).
99+
92100
### For testing purposes only
93101

94102
For testing only, you can use the following utilities to generate root, intermediate, and device certificates:
@@ -101,11 +109,6 @@ For testing only, you can use the following utilities to generate root, intermed
101109
- Use the verification code from the IoT Central application to generate the verification certificate.
102110
- Create leaf certificates for your devices using your device IDs as a parameter to the tool.
103111

104-
### Further reference
105-
106-
- [Sample implementation for RaspberryPi](https://aka.ms/iotcentral-docs-Raspi-releases)
107-
- [Sample device client in C](https://github.com/Azure/azure-iot-sdk-c/blob/master/provisioning_client/devdoc/using_provisioning_client.md)
108-
109112
## Connect without registering devices
110113

111114
The previously described scenarios all require you to register devices in your application before they connect. IoT Central also enables OEMs to mass manufacture devices that can connect without first being registered. An OEM generates suitable device credentials, and configures the devices in the factory. When a customer turns on a device for the first time, it connects to DPS, which then automatically connects the device to the correct IoT Central application. An IoT Central operator must approve the device before it starts sending data to the application.

0 commit comments

Comments
 (0)