Azure / Azure/azure-iot-sdk-java
[Technical Question] Why there is a need of intermediate certificate to provision a device through DPS group enrollments
- Dominant language
- Java
- Stars
- 210
- Forks
- 238
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 7
Description
I am provisioning a device through X509 certs and its strange that we need a intermediate cert to be used a signercertificate in the example given here (https://github.com/Azure/azure-iot-sdk-java/blob/main/provisioning/provisioning-device-client-samples/provisioning-X509-sample/readme.md) which mentions `Obtain the certificates following instructions from [X509 Certificate Generator](https://github.com/Azure/azure-iot-sdk-java/tree/main/provisioning/provisioning-tools/provisioning-x509-cert-generator). If you are trying Group Enrollment then you will need to add signerCertificates to the Collection. You can add the signerCertificates in main() just before instantiating SecurityProviderX509Cert: signerCertificates.add("");`
Now on the contrary I see this example also which doesn't uses the signerCertificate(Intermediate cert) and provisions a device using DPS group enrollment [](https://learn.microsoft.com/en-us/azure/iot-central/core/how-to-connect-devices-x509?pivots=programming-language-java) refer point 7 ` SecurityProvider securityProviderX509 = new SecurityProviderX509Cert(deviceX509Cert, deviceX509Key, null);
`
Now my questions are:-
1) The java sample I'm running works with intermediate certificate used as `signerCertificates` argument in here `SecurityProviderX509Cert(leafPublicCert, leafPrivateKey, signerCertificates)` so my certs are correct and DPS is also correctly configured. But when I pass null in `signerCertificates` the registerDevice call timeout and registration callback is never called. Which above example mentioned is correct? And why the second example doesn't work for me.
2) I have used node and c azure it sdk they don't need any intermediate certificate on a device for it to be provisioned to DPS using group enrollment. Why Java SDK needs that?
2) Also it would not a be a good solution for an Andorid app as that require the intermediatecertificate to be shipped with apk which is a security concern.
Contributor guide
Assessment
This issue has not been assessed yet.