I this link useful? I don't know too much about this, but I can do some more investigation and ask internally if the link didn't help.
Best regards,
Simon
Hi Simon,
thank your for your reply, but my question is how to generate all of this ON the nRF9160. Because if that would be possible
than the private key should not leave the device ensuring a higher security level compared to generating these keys outside of the device and transmitting over some channel.
Could you please ask for that? It would be good, if the key generation could happen on the device.
With kind regards,
Árpád
I'm sorry for the delay, somehow I left this ticket behind and forgot to do further investigation. I have asked some developers internally and currently waiting for an answer.
Best regards,
Simon
I got an answer on how to go about this:
"DER is just a binary encoded PEM. they can use base64_decode(), passing in the base64 text from the PEM (data between the BEGIN/END lines).
Best regards,
Simon
Hi Simon,
that is partially answer to my question. Thank you.
The rest of the question is:
is it possible -and if yes how- to generate elliptic curve keys and an x509 certificate needed by Google Cloud IoT on the nRF9160?
The generation with openssl on a desktop machine is described here:
I want to know whether it's possible to do the same - of course not with openssl- on the device itself.
Probably with the nrf_oberon crypto library?
For example I found ocrypto_ecdsa_p256_public_key in the nrf_oberon lib, but how to make an X509 certificate?
With kind regards,
Árpád
Hi Simon,
that is partially answer to my question. Thank you.
The rest of the question is:
is it possible -and if yes how- to generate elliptic curve keys and an x509 certificate needed by Google Cloud IoT on the nRF9160?
The generation with openssl on a desktop machine is described here:
I want to know whether it's possible to do the same - of course not with openssl- on the device itself.
Probably with the nrf_oberon crypto library?
For example I found ocrypto_ecdsa_p256_public_key in the nrf_oberon lib, but how to make an X509 certificate?
With kind regards,
Árpád
Hi Árpád,
I would assume that you could do this using the X.509 module in mbed TLS. It has support for building X509 certificates. I have not tested this myself though, and cannot provide any more details.
Einar
Hi Einar,
thank you for your reply. Unfortunately
CONFIG_MBEDTLS_X509_LIBRARY=y
depends on
CONFIG_NORDIC_SECURITY_BACKEND=y CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"
get_target_property() called with non-existent target "platform_cc310".
I build for nrf9160dk_nrf9160ns.
How can I setup prj.conf to get the mbedTLS X509 module?
Why does the mbedTLS depends on CONFIG_NORDIC_SECURITY_BACKEND?
mbedTLS is a standalone lib, why is this dependency?
Here are my mbed config settings:
# Generate keys CONFIG_MBEDTLS=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y CONFIG_MBEDTLS_ENTROPY_ENABLED=y # Create certificate CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h" CONFIG_NORDIC_SECURITY_BACKEND=y # Why this depends on CONFIG_NORDIC_SECURITY_BACKEND?? CONFIG_MBEDTLS_X509_LIBRARY=y
Best regards,
Árpád
Hi Árpád,
This is not straightforward.
PopradiArpad said:
Why does the mbedTLS depends on CONFIG_NORDIC_SECURITY_BACKEND?
mbedTLS is a standalone lib, why is this dependency?
You need an entropy source in order to generate random numbers, and the only entropy source available to the application on the nRF9160 is the TRNG within the CC310 peripheral. The API for the CC310 in the nRF Connect SDK is mbed TLS, via the nordic security backend. This is still ongoing work, though. We do not have a proper solution ready at the moment.
It might be better to find some other way to generate the X509 certificate in pure SW, but in that case, it would only be for experimentation, as you will not have a usable secure solution without a proper entropy source.
Einar
Hi Einar,
thank you for your fast answer. I understand ongoing work :)
Approximately when do you have a proper solution?
Best regards,
Árpád
Hi Árpád,
I cannot comment on when new features will be available, unfortunately. However, I see I was a bit too pessimistic in my previous reply. You can in fact make your own solution, and use the RNG support in the CC310 via the Secure Partition Manager, which has the spm_request_random_number() function. See Secure services. This just gives you entropy, and then you can use a pure SW library of your preference for the rest.
Einar