I have 2048-bit raw RSA public key (no X509 certificate, only the 2048 bits). How to parse them in rsa_context or use it for encryption with rsa_rsaes_oaep_encrypt ( mode = RSA_PUBLIC ).
Thank you for your question!
In order to use the
mbedtls_rsa_rsaes_oaep_encrypt() API, you will need
mbedtls_rsa_context struct to be filled with the relevant data.
For that, I would suggest you look at this article which explain how to import the rsa context when you have the components.
Oncw you fill the context using
mbedtls_rsa_import_raw() you should be able to encrypt your data.
Mbed TLS Support