Detecting PGP 2.6.x keys

David Shaw dshaw at
Thu Sep 16 17:57:50 CEST 2004

On Thu, Sep 16, 2004 at 11:50:13AM -0400, David Shaw wrote:
> On Fri, Sep 10, 2004 at 09:15:26AM -0500, Aleksandar Milivojevic wrote:
> > I'm writing a shell script wrapper around gpg.  I need a way to detect
> > if the recipient's public key was generated by PGP 2.6.x so that I can
> > use appropriate options (in order for the recipient to be able to
> > decrypt the message).
> > 
> > I know that gpg is able to detect this type of key internally (for
> > example showpref run on such a key will result in appropriate error
> > message).  But there doesn't seem to be any option for listing the
> > keys that will include in the output that this is old PGP 2.6.x key.
> > I've tryied using --with-key-data, but there doesn't seem to be
> > documentation on output format, and the parts that I managed to
> > decode what they could be are not usefull for this purpose...
> There is no way to see the version of a key directly.  You can infer
> some information by noting that the V3 keys are sign+encrypt RSA,
> which is uncommon in the V4 world, but that doesn't guarantee a V3
> key.

Although, I should add that if you really want to see a key version,
you can do 'gpg --export key | gpg --list-packets' and pipe that
through something to parse out the key version.  That's not a
supported interface though, and may change in the future.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 251 bytes
Desc: not available
Url : /pipermail/attachments/20040916/adf4f7a2/attachment.bin

More information about the Gnupg-users mailing list