x509azure-iot-hubazure-iot-sdkazure-iot-dps

setting deviceID when provisioning with custom HSM


I am trying to prototype a X509 certificates based group enrollment, and not for only one device (as dice_device_enrollment by default would provide), but for several, and, from what I learned, I will need to implement my own custom HSM library. While most of the latter seems straightforward, I have a difficulty with setting deviceID. The document says the following:

custom_hsm_get_common_name

char* custom_hsm_get_common_name(HSM_CLIENT_HANDLE handle);

    Retrieves the common name from the x509 certificate. 
    Passed to the Device Provisioning Service as a registration Id.

My difficulty is - if "registration ID" is deviceID, and an X509 certificate has only one common name, how am I supposed to provision multiple devices in a group? Or, is there any other way that deviceID is set? Currently by analysing the code of hsm_client_riot.c I can't see that.


Solution

  • Just to close this one. Since July 2019 a new version of Azure IoT SDK for Python has been released, which handles device provision better than the old SDK (which I was referring to). The question is obsolete now. Use the new SDK.