(Answer) (Category) Crypto++ Faq-O-Matic :
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.
2001-Oct-29 10:56pm mschatz, weidai

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: (Answer) How do I encrypt a message using a *private* key? (example of using signature with recovery)
Next: (Answer) The sample code shows how to work with a file, but my data is in a string (or vice versa).
This document is: http://www.cryptopp.com/cgi-bin/fom.cgi?file=62
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.721.
This FAQ is administered by Wei Dai.