Hi Federico,
Mbed TLS does support your use cases.
You can find more informatino in the following articles:
- https://tls.mbed.org/kb/cryptography/rsa-key-pair-generator
- https://tls.mbed.org/kb/how-to/generate-a-certificate-request-csr
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.
Regards,
Mbed TLs Team member
Ron