1 (edited by Philhippus 2012-06-07 06:35:54)

Topic: How to convert pem format key to RsaKey?

I want to sign a certificate using the SignCert() function, but the private key (&caKey) is in pem format. How can I convert the key from pem and store it in an RsaKey struct?

Thanks.

Share

Re: How to convert pem format key to RsaKey?

Hi,

To convert your private key from PEM format to DER format, you should be able to use the wolfSSL_KeyPemToDer() function.  After you have converted the key to DER format, it is able to be loaded into an RsaKey struct using the RsaPrivateKeyDecode() function.

Best Regards,
Chris

Re: How to convert pem format key to RsaKey?

Thanks Chris

Exactly the answer I needed.
For future searchers: chapter 10 of the wolfSSL embedded ssl manual, section 10.5 Public Key Cryptography, elaborates on this a bit.

Share

Re: How to convert pem format key to RsaKey?

[ Edited, duplicate post (ref: http://www.yassl.com/forums/topic189-cy … ties.html) ]

Re: How to convert pem format key to RsaKey?

@sumathi you have not provided much detail as to what you have done.

"I let wolfSSL take over as server"  - have you imported your CA into the browsers' CTL? Are you successfully generating signed certificates on the fly as encrypted traffic passes through your proxy? If yes to the previous two questions, have you tested your proxy on  multiple browsers or just one?

Unless you are trying to filter SSL traffic through your proxy, you should tunnel the secure traffic - no need to use any SSL library.

Share