qadwjoh has asked for the wisdom of the Perl Monks concerning the following question:

Hi

Does anyone know of a Perl module which can take a PGP key and return details about it such as whether it's a public or private key, it's key ID, the user ID associated with the key,...etc? I tried looking on cpan, but couldn't find anything.

Thanks
A

Replies are listed 'Best First'.
Re: PGP key details
by gaal (Parson) on Jul 02, 2004 at 10:36 UTC
      This is a wrapper around the GnuPG program itself. Are there any modules that don't require the software?

        I'm not aware of something that does what you want (extract key metadata in pure perl). But consider that driving gpg is probably the Right Way to do this: crypto is hard enough to get right, and it's better to keep your bugs in only one implementation.

        Maybe it would have been cleaner if there were a libgnupg that both gpg and the Perl modules would act as frontends for, instead of gpg providing runtime hooks; but it seems to work well enough now. (There are GUI frontends to gpg that seem to interface to it in the same manner.)

        What's bothering you, is it the extra dependency? Size? Performance? If you really do need a well-defined subset that's so small that it doesn't warrant bringing in gpg, perhaps you could reimplement it yourself; but I wouldn't expect many people to have had the exact same subset requirements already.

        BTW, since your original post I noticed GnuPG::Interface too, but I think it follows the same design. Don't know which is newer or better.