How to generate a private key (RSA or ECC)

Hi there,

I’m working on an embedded MCU and I these is what I want to do:

  1. Generate a new private key (RSA or ECC)

  2. Generate a CSR starting from the private key.

My question is: is it possible to generate a RSA private key with mbedTLS?
Is also possible to generate the Certificate Signing request (CSR) from the private key?

I’m relative new to mbedTLS.
Thanks in advance.


Hi Federico,
Mbed TLS does support your use cases.
You can find more informatino in the following articles:

Note these articles explain how to use the example reference applications to do what you need, but you can look at these examples, and see how to gerenrate a keypair, and how to generate a CSR.
I recommend you also look at the Mbed TLs tutorial if you are relatively new to Mbed TLS.
Mbed TLs Team member

1 Like

Hi Ron,

thanks for your detailed reply.
I’ll start to embed mbedTLS in my firmware application.

Best Regards,