I have the following function (see below post) I wrote to verify
signatures.

The line

StringSource SignatureFile(aSignature, true, new HexDecoder);

fails to verify the signature

but.. if I add the signature instead of passing it, it works!

ie: StringSource
SignatureFile("64237E8311F63386863CCE2BC6BB69E6216B0D569259AE3A10633FDECEAB445BF77569D2BEF0068B",
true, new HexDecoder);

Can anyone help?

Many thanks

Colin

bool LicenseManager::validate(License license, string publicKey,
string aSignature){
        StringSource pubFile(publicKey, true, new HexDecoder);
        StringSource SignatureFile(aSignature, true, new HexDecoder);

        // Verifier Object
        DSA::Verifier pub(pubFile);

        if (SignatureFile.MaxRetrievable() != pub.SignatureLength()){
                cerr << "Problem with the signature\n";
        return false;
        }

        SecByteBlock signature(pub.SignatureLength());
        SignatureFile.Get(signature, signature.size());

        // Setup
        VerifierFilter *verifierFilter = new VerifierFilter(pub);
        verifierFilter->Put(signature, pub.SignatureLength());

        // Invoke Verifier
        string message = license.getFingerprint();
        cout << "Fingerprint to verify is: \""<< message << "\"\n";
        StringSource(message, true, verifierFilter);

        if(verifierFilter->GetLastResult()){
                return true;
        }
        else{
                return false;
        }
}


--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---

Reply via email to