GnuPG 的 --list-sigs 输出是什么意思?

信息安全 电子签名 gnupg 打开pgp 信任网络
2021-08-30 15:40:37

gpg --list-sigs给了我类似以下的东西(我编辑了输出只是为了显示有趣/不同的行):

pub   2048R/4ACE309C 2016-11-01
uid                  lala_test2 <lala2@test.org>
sig 3        4ACE309C 2016-11-01  lala_test2 <lala2@test.org>
uid                  test_key <test_key@test.org>
sig 3        4ACE309C 2016-11-01  lala_test2 <lala2@test.org>
sub   2048R/EA9FDC87 2016-11-01
sig          4ACE309C 2016-11-01  lala_test2 <lala2@test.org>
sig 2        03A9DA1F 2014-02-11  [User ID not found]
sig 3        5B51CBCF 2011-10-25  [User ID not found]
sig 3        06B47049 2011-10-26  [User ID not found]
sig 3        00C85EF1 2011-10-31  [User ID not found]
sig 3        5A4BEDCE 2011-10-06  [User ID not found]
sig        1 F2648165 2011-10-07  [User ID not found]
sig       X  CA57AD7C 2005-07-31  [User ID not found]
sig       X  CA57AD7C 2005-08-01  [User ID not found]
sig 2     X  DC79FAC9 2003-09-26  [User ID not found]
sig          7EE2682F 2016-06-03  [User ID not found]
rev          7EE2682F 2016-06-03  [User ID not found]

第一列中的标签表示:

  • pub -> 公钥
  • uid -> 用户 ID
  • sig -> 签名,来自另一个人说他信任 pub 标签下的密钥
  • 子 -> 子键
  • rev -> 这是签名者撤销其密钥的签名吗?

2048R -> 2048 是 RSA 的密钥大小和 R。还有短键ID,创建日期,最后一个是可用的用户ID。

第一列之后的 sig 行中的数字是什么意思?

2个回答

认证等级

有不同类别的认证。引用RFC 4880、OpenPGP、5.2.1。签名类型

[...]

0x10: Generic certification of a User ID and Public-Key packet.
   The issuer of this certification does not make any particular
   assertion as to how well the certifier has checked that the owner
   of the key is in fact the person described by the User ID.

0x11: Persona certification of a User ID and Public-Key packet.
   The issuer of this certification has not done any verification of
   the claim that the owner of this key is the User ID specified.

0x12: Casual certification of a User ID and Public-Key packet.
   The issuer of this certification has done some casual
   verification of the claim of identity.

0x13: Positive certification of a User ID and Public-Key packet.
   The issuer of this certification has done substantial
   verification of the claim of identity.

Most OpenPGP implementations make their "key signatures" as 0x10
certifications.  Some implementations can issue 0x11-0x13
certifications, but few differentiate between the types.

[...]

GnuPG 显示“普通”0x10签名 assig和高级签名,以区分不同类型的认证级别,并带有以下数字:0x11as sig 10x12assig 20x13as sig 3rev表示已撤销的签名。

--list-sigsGnuPG 手册页 ( ) 也解释了的输出man gpg

--list-sigs
    Same as --list-keys, but the signatures are listed too.  This command has the
    same effect as using --list-keys with --with-sig-list.

    For  each  signature listed, there are several flags in between the "sig" tag
    and keyid. These flags give additional information about each signature. From
    left  to  right,  they  are  the numbers 1-3 for certificate check level (see
    --ask-cert-level), "L" for a local or non-exportable signature (see  --lsign-
    key), "R" for a nonRevocable signature (see the --edit-key command "nrsign"),
    "P" for a signature that contains a policy URL (see  --cert-policy-url),  "N"
    for  a  signature  that contains a notation (see --cert-notation), "X" for an
    eXpired signature (see --ask-cert-expire), and the numbers 1-9 or "T" for  10
    and  above  to  indicate  trust  signature levels (see the --edit-key command
    "tsign").

模糊性

还要注意规范部分的第一段,它表明认证级别没有一般的、严格的定义:

签名有许多可能的含义,它们在任何给定签名中的签名类型八位字节中表示。请注意,这些含义的模糊性不是缺陷,而是系统的一个特点。因为 OpenPGP 将有效性的最终权威赋予签名的接收者,所以一个签名者的随意行为可能比其他权威的积极行为更严格。[...]

因此,有些人发布了认证政策。我在签署 PGP 密钥时你在说什么中提供了一些讨论?

试图从 Jens Erat 的人类语言帖子中澄清一些细节: " " => 0x00 Generic certification: does not make any particular ownership assertion "1" => 0x11 Persona certification: has not done any ownership verification "2" => 0x12 Casual certification: has done some identity verification "3" => 0x13 Positive certification: has done substantial identity verification

再次为了可读性: "L" for a Local or non-exportable signature (see --lsign- key) "R" for a non-Revocable signature (see --edit-key command "nrsign") "P" for a signature that contains a Policy URL (see --cert-policy-url) "N" for a signature that contains a Notation (see --cert-notation) "X" for an eXpired signature (see --ask-cert-expire) "T" or [1-9] indicate trust signature levels (see --edit-key command "tsign")