How to authenticate my device using x.509 certificate? and send messages to iot hub RRS feed

  • Question

  • hi,

    I had my root key and X509 cert, generated with the following command:

    openssl req -x509 -newkey rsa:2048 -keyout root_private.pem -nodes -out root_cert.pem

    Then, I needed to generate the verification cert...

    • Create verification key:

      openssl genrsa -out verification.key 2048
    • Create the verification cert:

      openssl req -new -key verification.key -out verification.csr

    When creating the verification cert, I need to specify the verification code obtained (7A69A4702DA903A41C3A5BC5575A8E3F49BEC5E5BA2D4CE1) as the "Common Name" certificate field.

    Now, just create the proof of possession certificate with the following command:

    openssl x509 -req -in verification.csr -CA root_cert.pem -CAkey root_private.pem -CAcreateserial -out verificationCert.pem -days 1024 -sha256

    If I am not wrong, this last command signs the verification.csr, that has the verification code as the

    Common Name, with the root private key. At the end, the verificationCert.pem can be used as the

    proof of possession.

    and created x.509 certificates and uploaded it to mu iot hub and also got them verified.

    now when i am trying to send sensor data from my device (rpi) to that virtual device on my iot hub (via a python code) it shows "connections not authorized"

    how should i authenticate my rpi (device)  with those x.509 certificates?

    please help me out.

    Thursday, September 26, 2019 7:15 AM

All replies