This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RSA keys in DER format

In nRF SDK 1.2.0 and 1.3.0, there is a function to generate the public/private RSA keys in http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/doc/api.html#_CPPv422mbedtls_rsa_gen_key_fn

But is there any library available to write the generated RSA public key in DER format?
That would be similar to mbedtls_pk_write_pubkey_der in https://github.com/ARMmbed/mbedtls/blob/development/library/pkwrite.c

We expect the public key to be imported with https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#SubjectPublicKeyInfo
Let us know,
Thanks, and stay safe!
Parents Reply
  • No this will be on the nrf9160. Any particular reason why the defines like MBEDTLS_PK_C, MBEDTLS_PK_WRITE_C and MBEDTLS_PK_PARSE_C are undefined in nrf-config.h ? Since these are undefined what are the alternatives to generate the private/public keys as strings from the exported RSA context ? There is a define like MBEDTLS_PEM_WRITE_C and what good is it if the MBEDTLS_PK_C is undefined ?

Children
Related