Hello,
I have a PEM encoded private RSA key that I used for decryption. The
key works fine with OpenSSL and various other crypto libraries, but I
cannot use it with Crypto++. Here's what I've tried to do to load it
into Crypto++:
1. I convert the key to der format using OpenSSL:
openssl rsa -in key.pem -outform DER -out keyout.der
2. I then try to load the key with Crypto++:
CryptoPP::RSA::PrivateKey PK;
CryptoPP::ByteQueue bytes;
CryptoPP::FileSource File( rsa_private_keyfile.c_str(),
true );
File.TransferTo( bytes );
bytes.MessageEnd();
// This line causes BER decode error
PK.Load( bytes );
At first, I suspected something was wrong with the key, but after
successfully using it with OpenSSL and a few other libraries, I now
suspect that it's something I've done wrong within Crypto++. To
further confuse things, the above code loads and validates other
private RSA keys just fine.
Any ideas or suggestions are appreciated.
Brad
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.