Part of question remains unanswered.
1. What should be returned on custom_hsm_get_common_name
for group enrollment. Yes, I can assume that is leaf name. But not specified.
2. Even now no where it is specified what should be certificate format(PEM/DER etc) other than in my earlier Github ticket. Also no where in C SDK it is specified we should limit alphanumeric and hyphens in common name. The lib user will need to read Node.JS SDK docs to get to that point.
Please imagine what a new developer have to go through to get this working. They are not at lib developers expertise level. The point I want to bring out is, things like these are left unspecified and left to the imagination or common sense of lib user (azure-iot-sdk-c) which shouldn't be the case. Also, regarding functionality, the point of HSM is keys never leave the HSM. That is broken from beginning. Yes, lib user can modify this open source library to make sure keys never leaves HSM. But again, the provisioning service is a paid service. Regarding HSM functionality or C SDK documentation, this provisioning service as of today, is better left in public preview.
The intention is not to be offensive here. Just letting developers know the thoughts.