0

I have setup a group enrollment in the the Azure Device provisioning service with a root certificate that has been validated.

Using openssI I created root and leaf certificates. If I run a cmake on the custom_hsm using the 'c' azure iot sdk's and providing the leaf cert, private key, and common name, should this allow me to then compile and run the prov_dev_client_sample.c (with correct scope and url) without having to build the visual studio Azure_IoT_sdks.sln.

I am currently running on Linux and would like to know if it's possible to bypass that step of building the visual studio solution.

Please, let me know if clarification is needed. Question should be understandable my MS devs who monitor azure-iot-hub.

radish25
  • 75
  • 7

2 Answers2

1

prov_dev_client_sample.c has list of dependencies (covered by the solution files) and those are necessary to compile the source file successfully. You didn't mention the reason you don't want to build the sln. If you simply want to use such functionality without depending on another project structure, you can look into CMakeLists.txt and create the one for yourself .. i.e. cmake . -G "Visual Studio 14"

Ozzz
  • 300
  • 1
  • 7
  • I'm on Ubuntu 16.04 so would I be able to build that on my system. Apparently a google search says that you can use xbuild, are you familiar with that for this purpose? – radish25 Jul 27 '18 at 20:47
  • yes, on ubuntu, you don't need to export. I don't think you need xcode? either – Ozzz Jul 28 '18 at 05:46
0

In addition to Ozzz's mention, this cmake command cmake -Duse_prov_client:BOOL=ON .. will enable provisioning device sdk. After built, you will find the targets include provisioning client samples in cmake directory.

cd azure-iot-sdk-c
mkdir cmake
cd cmake
cmake -Duse_prov_client:BOOL=ON ..
cmake --build .

This document described how to set up a development environment for the C SDK on Ubuntu.

Michael Xu
  • 4,382
  • 1
  • 8
  • 16
  • Hi Michael, I think I am a bit confused about the whole attestation mechanism. If I want to use an x509 certificate that I create myself perhaps using openssl, is there a way to provision a device using C on linux without using the DICE emulator in windows? If so is this through using a custom_hsm library? Thanks – radish25 Jul 30 '18 at 18:45
  • For example in node we can simply provide the url, scope, .pem, and key files to allow to attest to the DPS with an x509 certificate. How can I achieve this in C on linux. – radish25 Jul 30 '18 at 19:05