5 years, 6 months ago.

Error while loading the RSA private key file for parsing to generate CSR?

I have generated RSA public and private key pair and now I am trying to generate CSR by mbedtls_pk_parse_keyfile() API (mbedTLS/programs/x509/cert_req.c) https://github.com/ARMmbed/mbedtls/blob/development/programs/x509/cert_req.c

I am getting an error while trying to load the private key file in pk context using mbedtls_pk_parse_keyfile(), which takes 3 arguments as given by this link https://tls.mbed.org/api/pk_8h.html#a935d710e542409462d0209f2381da83e

This function is returning an error -15616. I checked the private key file by printing the key value and the path of private keyfile. I set the password as NULL. Has anyone of you come across this issue or know what this error means? Could anyone of you please help or guide me how to solve this? Any help is appreciated.

Thank you

Be the first to answer this question.