It's perfect! Thank you. Ventura
Jeffrey Walton wrote: > Hi Venturea, > > The following might help. > http://www.codeproject.com/KB/security/CryptoInteropSign.aspx > > Jeff > > On Tue, Dec 30, 2008 at 8:47 PM, Ventura <[email protected]> > wrote: > >> I am trying to check a file signature using an DSA key exported in >> binary. The idea is not have to install the public key in the key >> server ring but keep inside the code to check a file signed by the >> private key. My test code is: >> >> // >> // Private key exported by gpg --export <email> > pubkey.dat >> // and converted to C vector using khexdit >> // >> unsigned char pub_rem_key[937]= >> { 0x99,0x01,0xa2,0x04,0x49,0x5a,........}; >> >> >> int >> main (int argc, char **argv) >> { >> // Signature verification >> FileSink test("test.txt", false); >> ArraySink bufArr(pub_rem_key, sizeof(pub_rem_key)); >> >> DSA::PublicKey dsaPublicKey; >> dsaPublicKey.Load(bufArr); >> >> DSA::Verifier verifier(dsaPublicKey); >> >> .... >> // more code >> .... >> >> exit(0); >> } >> >> Unfortunately the code is throwing an exception when I try to load the >> bufArr in the dsaPublicKey. >> >> terminate called after throwing an instance of >> 'CryptoPP::BERDecodeErr' >> what(): BER decode error >> Aborted >> >> I think I have to do something with bufArr before load the key. >> >> Any suggestion is welcome. Thanks in advance, >> Jorge Ventura >> >> >> >> --~--~---------~--~----~------------~-------~--~----~ 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. -~----------~----~----~----~------~----~------~--~---
