You are right. I was trying to use a key generated by  GnuPG and this one
it's not in the DER format.

I did a test using one generated by openssl in the DER format and it works.

What I am trying to do is that my code just check the signature in a 
text file.

Unfortunately when I use crypto++ I have to have the text and signature
in  separated files (if I am understanding crypto++). When you sign a file
with GnuPG, the signature stay in the bottom of the file, with openssl you
have two files, one with the text and another one with the signature.

One solution (I guess) is use the library gpgme, the library from GnuPG
but I have been using crypto++ for all of my code and I wouldn't like to
have second library in the program.

Do you have a better suggestion so that I can remain using Crypto++ ???

Thanks in advance,
Jorge Ventura



Geoff Beier wrote:
> On Wed, Dec 31, 2008 at 17:55, Ventura <[email protected]> wrote:
>   
>> How do I setup a DSA::PublicKey object with the data from a binary
>> file generated
>> using "gpg --export" ???
>>
>>     
>
> That file doesn't contain a DER-encoded subjectPublicKeyInfo
> structure. If you want to parse it, look at RFC 4880 for documentation
> of the packet format. Here's an example that gets openpgp keys into
> OpenSSL:
>
> http://cypherspace.org/openpgp/pgpdsa/
>
> Obviously, that won't map perfectly to crypto++, but it should get you
> a jump start on the file format. To make something that's general and
> robust (that example clearly isn't), I think I'd consider using GNUTLS
> OpenPGP support to produce a utility that converts the exported public
> key to a subjectPublicKeyInfo structure, then using that with
> crypto++.
>
> HTH,
>
> Geoff
>   

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