Hey
I was just reading the example with the C# SDK, and in the provisioning sample we have to provide the intermediate cert which signed the device certs (public and private keys) through the APIs (using this)
By adding to the
prov_dev_sample.c
the content of the intermediate cert ( ./certs/azure-iot-test-only.intermediate.cert.pem) with :
Prov_Device_SetOption(prov_device_handle, OPTION_TRUSTED_CERT, CERTIFICATE);
And by changing in the group enrollment the
Certificate type :
property to use the intermediate cert instead of the root CA, it seems to provision correctly :
run the provisioning sample...
Provisioning API Version: 1.3.5
Not using proxy
custom_hsm_get_common_name
custom_hsm_get_certificate
custom_hsm_get_key
Registering Device
-> 11:12:36 CONNECT | VER: 4 | KEEPALIVE: 0 | FLAGS: 130 | USERNAME: SCOPE_ID/registrations/REGISTRATION_ID/api-version=2019-03-31&ClientVersion=1.3.5 | CLEAN: 1
11:12:36 SUBSCRIBE | PACKET_ID: 1 | TOPIC_NAME: $dps/registrations/res/# | QOS: 1
Provisioning Status: PROV_DEVICE_REG_STATUS_INVALID
11:12:36 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $dps/registrations/PUT/iotdps-register/?$rid=1 | PAYLOAD_LEN: 29
11:12:36 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $dps/registrations/GET/iotdps-get-operationstatus/?$rid=2&operationId=4.5fdbf7a9b6727138.b3830166-57e6-4db0-bece-4277323451fc | PAYLOAD_LEN: 29
11:12:39 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $dps/registrations/GET/iotdps-get-operationstatus/?$rid=3&operationId=4.5fdbf7a9b6727138.b3830166-57e6-4db0-bece-4277323451fc | PAYLOAD_LEN: 29
11:12:39 DISCONNECT
Press enter key to exit:
What do you think ?