我如何知道公钥使用的是哪个版本的 PGP?

我如何知道公钥使用的是哪个版本的 PGP?

假设我有多个密钥,一些遵循 PGP 5,另一些遵循 PGP 2,也许还有一些是用原始 PGP 制作的。我该如何辨别呢?

答案1

使用命令gpg -v [my-key-file]可以为您提供相关信息。(使用-vv而不是-v提供更多信息)。该gpg命令将尝试猜测您的意思并假设您想要打印关键信息。例如,如果我运行

gpg -vv E82ED48BE6BC6DDAFC89509D62464EEB7E00F58D.asc

我明白了

gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: armor: BEGIN PGP PUBLIC KEY BLOCK
# off=0 ctb=99 tag=6 hlen=3 plen=525
:public key packet:
    version 4, algo 1, created 1593060860, expires 0
    pkey[0]: [4096 bits]
    pkey[1]: [17 bits]
    keyid: 62464EEB7E00F58D
# off=528 ctb=b4 tag=13 hlen=2 plen=5
:user ID packet: "Babba"
# off=535 ctb=89 tag=2 hlen=3 plen=590
:signature packet: algo 1, keyid 62464EEB7E00F58D
    version 4, created 1593060860, md5len 0, sigclass 0x13
    digest algo 8, begin of digest af c1
    hashed subpkt 33 len 21 (issuer fpr v4 E82ED48BE6BC6DDAFC89509D62464EEB7E00F58D)
    hashed subpkt 2 len 4 (sig created 2020-06-25)
    hashed subpkt 27 len 1 (key flags: 03)
    hashed subpkt 11 len 4 (pref-sym-algos: 9 8 7 2)
    hashed subpkt 21 len 5 (pref-hash-algos: 10 9 8 11 2)
    hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
    hashed subpkt 30 len 1 (features: 01)
    hashed subpkt 23 len 1 (keyserver preferences: 80)
    subpkt 16 len 8 (issuer key ID 62464EEB7E00F58D)
    data: [4095 bits]
# off=1128 ctb=b9 tag=14 hlen=3 plen=525
:public sub key packet:
    version 4, algo 1, created 1593060860, expires 0
    pkey[0]: [4096 bits]
    pkey[1]: [17 bits]
    keyid: 7116EC30AC0012C2
# off=1656 ctb=89 tag=2 hlen=3 plen=566
:signature packet: algo 1, keyid 62464EEB7E00F58D
    version 4, created 1593060860, md5len 0, sigclass 0x18
    digest algo 8, begin of digest c6 68
    hashed subpkt 33 len 21 (issuer fpr v4 E82ED48BE6BC6DDAFC89509D62464EEB7E00F58D)
    hashed subpkt 2 len 4 (sig created 2020-06-25)
    hashed subpkt 27 len 1 (key flags: 0C)
    subpkt 16 len 8 (issuer key ID 62464EEB7E00F58D)
    data: [4093 bits]
pub   rsa4096 2020-06-25 [SC]
      E82ED48BE6BC6DDAFC89509D62464EEB7E00F58D
uid           Babba
sig        62464EEB7E00F58D 2020-06-25   [selfsig]
sub   rsa4096 2020-06-25 [E]
sig        62464EEB7E00F58D 2020-06-25   [keybind]

相关内容