namespaces... On 6/9/09, Gary <[email protected]> wrote: > > Dear Jeff! > > I changed the mentioned code as below: > > #include "stdafx.h" > #include "rsa.h" > #include "osrng.h" // PRNG > #include "hex.h" // Hex Encoder/Decoder > #include "files.h" // File Source and Sink > #include "filters.h" > > int main(int argc, char* argv[]) > { > try > { > // Files > std::string PublicKeyFile = "key.pb"; > std::string SignedFile = "message.sig"; > > std::cout << "Public Key File: " << PublicKeyFile.c_str() << > std::endl; > std::cout << "Signature File: " << SignedFile.c_str() << > std::endl; > > // Message M > std::string message = "Yoda said, Do or Do Not. There is not > try."; > > // Load Public Key > CryptoPP::FileSource pubFile( PublicKeyFile.c_str(), true, > new CryptoPP::HexDecoder ); > > // Verifier Object > CryptoPP::RSASSA_PKCS1v15_SHA_Verifier pub(pubFile); > > // Intialize File Source > CryptoPP::FileSource SignatureFile( SignedFile.c_str(), > true, new CryptoPP::HexDecoder); > > // Sanity Check > if (SignatureFile.MaxRetrievable() != pub.SignatureLength()) > { throw std::string( "Signature File Size Problem" ); } > > CryptoPP::SecByteBlock signature( pub.SignatureLength() ); > SignatureFile.Get( signature, signature.size() ); > > // Prepare Verifier > CryptoPP::VerifierFilter *verifierFilter = > new CryptoPP::VerifierFilter(pub); > verifierFilter->Put(signature, pub.SignatureLength()); > > // Invoke Verifier > // CryptoPP::StringSource( message, true, verifierFilter ); > CryptoPP::StringSource( message, true, new Redirector > (verifierFilter,PASS_EVERYTHING)); > > // Paydirt > if( false == verifierFilter->GetLastResult() ) > { throw std::string( "Signature Verification Failed" ); } > > std::cout << std::endl << "Signature Verified" << std::endl; > > } // try > > catch( CryptoPP::Exception& e ) { > std::cerr << "Error: " << e.what() << std::endl; > } > > catch (...) { > std::cerr << "Unknown Error" << std::endl; > } > > return 0; > } > > > But I get this errors: > > > > Compiling... > RSASignVer.cpp > d:\rsasignver.cpp(64) : error C2061: syntax error : identifier > 'Redirector' > > d:\rsasignver.cpp(64) : error C2065: 'PASS_EVERYTHING' : undeclared > identifier > > d:\rsasignver.cpp(64) : error C2143: syntax error : missing ';' before > ')' > > d:\rsasignver.cpp(64) : error C2143: syntax error : missing ';' before > ')' > > RSASignVer - 4 error(s), 0 warning(s) > > What's the problem? > > > How do you change this code to work properly? > > Best Regards. > Gary > > > > On Jun 7, 11:53 pm, Gary <[email protected]> wrote: > > Hi dear Jeff! > > > > I tried "RSASignVer" code which is available in "Wiki" site,it's > > character set is non-UNICODE (MultiByte); > > > > I changed "message" string in this code and expected to get > > ("Signature Verification Failed" ) > > But I saw ("Signature Verified") again!! > > > > In your opinion,What's this problem's reason? > > > > Regards. > > Gary > > >
--~--~---------~--~----~------------~-------~--~----~ 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. -~----------~----~----~----~------~----~------~--~---
