I currently use the following command to sign a short message:
openssl pkeyutl -sign -in message -inkey privateKey.pem -out signedMessage
I am trying to use CryptoPP to verify and recover this message (using the public key). Note that this openssl command does not generate or use a digest; it signs the original message. This may be undesirable but I need my implementation to work with messages that have already been signed in this way.
If I use
RSA::PrivateKey privateKey;
privateKey.Load(FileSource("privateKey", true, NULL, true /*binary*/).Ref());
RSASS<PSSR, SHA1>::Signer signer(privateKey);
... then I can sign a message but the output is different for every run. The openssl command above always gives the same output, and I need CryptoPP to reproduce this. I think this is to do with the hash function (digest) that CryptoPP is including (as per convention) and that I can't work out how to exclude.
Similarly, if I try to use a RSASS<PSSR, SHA1>::Verifier to do a RecoverMessage on the output of openssl (which is my ultimate goal), the verification fails.
Is there a way to define a Verifier that does not expect to find a hash value?
P.S. Please be gentle; cryptography is definitely not my thing...