0

While reading RFC 4880 for OpenPGP, I read about version 3 and version 4 of OpenPGP keys. I do not understand what these versions mean other than specifying the packet format.

How can I find out a version of a key? I know for code we can use Bounce Castle's PGPPublicKey's getVersion(), but is there any command like keytool which I can use?

Jens Erat
  • 37,523
  • 16
  • 80
  • 96
user1484793
  • 359
  • 3
  • 16

1 Answers1

1

There is not a lot of difference between version 3 and 4 OpenPGP key packets, even the format is very similar. In version 4, the validity period was moved to special signatures, and fingerprint calculation changed. In detail, the changes (and formats) are described in OpenPGP, RFC 4880, 5.5.2. Public-Key Packet Formats. For signature packets, the differences are more significant.

To find the package version with readily-build tools, use gpg --list-packets or pgpdump, for example:

$ gpg --export a4ff2279 | gpg --list-packets
:public key packet:
    version 4, algo 1, created 1356475387, expires 0
    pkey[0]: [8192 bits]
    pkey[1]: [17 bits]
    keyid: 4E1F799AA4FF2279

[snip]

OpenPGP version 3 keys are deprecated for quite a while now, and rarely seen in usage.

Community
  • 1
  • 1
Jens Erat
  • 37,523
  • 16
  • 80
  • 96