On Friday, August 16, 2013 3:28:52 AM UTC-4, robert.hegner wrote: > > Hi there! > > I have a binary file with the following content > > - length of the signature as an uint32 > - signature > - length of the data as an uint32 > - data > > and I'd like to verify the data. First I create my verifier like this: > > CryptoPP::RSA::PublicKey publicKey; > CryptoPP::Integer n(PUBLIC_KEY_MODULUS, sizeof(PUBLIC_KEY_MODULUS)); > CryptoPP::Integer e(PUBLIC_KEY_EXPONENT, sizeof(PUBLIC_KEY_EXPONENT)); > publicKey.Initialize(n, e); > CryptoPP::RSASS<CryptoPP::PKCS1v15, CryptoPP::SHA1>::Verifier > verifier(publicKey); > ...
But it returns false. I also tried this: > > CryptoPP::FileSource fileSource(packagePath.c_str(), true); > CryptoPP::VerifierFilter verifierFilter(verifier); > uint32_t len; > fileSource.GetWord32(len); > fileSource.TransferTo(verifierFilter, len); > fileSource.GetWord32(len); > fileSource.TransferTo(verifierFilter, len); > bool valid = verifierFilter.GetLastResult(); > I also forgot to mention.... By default, SignatureVerificationFilter uses SIGNATURE_AT_END. If you want to insert the signature first, you should use SIGNATURE_AT_BEGIN. See http://www.cryptopp.com/wiki/SignatureVerificationFilter. Jeff -- -- 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. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
