I am trying to sign a message using a private key that is encrypted, of course I have a password for it, so I am trying to decrypt the key so that I can use it for signing.
I use C ++ library crypto++, this is the code that I am trying to use to read a key from a file
string keyString;
FileSource fs(keyFileName.c_str(), true, new DefaultDecryptorWithMAC(passphrase, new StringSink(keyString)));
At the same time it rises CryptoPP::DefaultDecryptor::KeyBadErr, I know that I have the correct password, because I was able to decrypt the key using openssl with the following command line:
openssl pkcs8 -inform DER -passin pass:PASSPHRASE < emisor.key
This is my first post, I'm not sure that I follow all the rules to ask a question, but any help or hint will be appreciated.
Hi,
heavy
source
share