Having solved the decryption problem I no have a similar problem with
signature verification.
The java side is signing the message with their private key as follows
-
Signature signature = Signature.getInstance("SHA1withRSA",
"BC");
signature.initSign(privateKey);
signature.update(plaintext.getBytes("UTF-8"));
byte[] sigValue = signature.sign();
String sign = new String(Base64.encodeBase64(sigValue));
I am then attempting to verify the signature in Crypto++ with their
public key as follows -
FileSource pubFile(pubFilename.c_str(), true);
RSASS<PKCS1v15, SHA>::Verifier pub(pubFile);
StringSource ssignature(sig, true, new Base64Decoder);
if (ssignature.MaxRetrievable() != pub.SignatureLength())
return false;
SecByteBlock signature(pub.SignatureLength());
ssignature.Get(signature, signature.size());
VerifierFilter *verifierFilter = new VerifierFilter(pub);
verifierFilter->Put(signature, pub.SignatureLength());
StringSource f(txt, true, verifierFilter);
return verifierFilter->GetLastResult();
However the verifier always returns false.
What am I doing wrong?
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---