|
|
How can I use an RSA key from Crypto++ in openssl? |
| Moderator: weidai (inherited from parent) | |
| An RSA key generated with Crypto++ encoded with DER can be used in openssl if the key is specified to be PKCS#8 encoded. For example if a 4096 bit RSA public key is generated with:
AutoSeededRandomPool rng;
RSAES_OAEP_SHA_Decryptor priv(rng, 4096);
TransparentFilter privFile(new FileSink("rsakey.der"));
priv.DEREncode(privFile);
privFile.MessageEnd();
The key can be converted by openssl with:
`openssl pkcs8 -in rsakey.der -inform DER -out rsakey.pem -nocrypt` Furthermore, the key can now be verified as a valid RSA key with: `openssl rsa -in rsakey.pem -check`
See the openssl man page for more information about using openssl.
| |
| See http://www.cryptopp.com/wiki/Basic_Encoding_Rules for more information related to key format.
2007-Dec-09 6:36pm weidai | |
| [Append to This Answer] | |
| 2007-Dec-09 6:36pm |
| Previous: |
|
| Next: |
|
| ||||||||||