我正在尝试将本地签名添加到我的密钥环中的一些公钥中,但使用gpg --lsign-key失败并显示“无密钥”消息,尽管事实上gpg --sign有效。我使用 Yubikey 作为智能卡。
GPG 显示密钥不可用,但附加的智能卡上有签名密钥:
$ gpg --list-secret-keys
sec# rsa4096/0xDEADBEEFDEADBEEF 2000-01-01 [SC]
Key fingerprint = DEAD BEEF DEAD BEEF DEAD BEEF DEAD BEEF DEAD BEEF
uid [ultimate] My Name <me@example.com>
ssb> rsa4096/0x8BADF00D8BADF00D 2000-01-01 [E] [expires: 2020-12-31]
ssb> rsa4096/0xBADDCAFEBADDCAFE 2000-01-01 [S] [expires: 2020-12-31]
ssb> rsa4096/0xFACEFEEDFACEFEED 2000-01-01 [A] [expires: 2020-12-31]
我可以签署一条消息:
$ echo "test" | gpg --sign --armor
gpg: using "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF" as default secret key for signing
-----BEGIN PGP MESSAGE-----
[snipped signature]
-----END PGP MESSAGE-----
但我不能--lsign-key:
$ gpg --lsign-key product-security@apple.com
pub rsa4096/0x782F6D86DED32B71
created: 2018-08-20 expires: 2019-08-20 usage: SC
trust: marginal validity: unknown
sub rsa4096/0x1C3F44E9CB9F9E3A
created: 2018-08-20 expires: 2019-08-20 usage: E
[ unknown] (1). Apple Product Security <product-security@apple.com>
[ unknown] (2) Apple Product Security Notifications <product-security-noreply@lists.apple.com>
Really sign all user IDs? (y/N) y
gpg: using "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF" as default secret key for signing
pub rsa4096/0x782F6D86DED32B71
created: 2018-08-20 expires: 2019-08-20 usage: SC
trust: marginal validity: unknown
Primary key fingerprint: 0CD5 C954 D089 2440 1598 9759 782F 6D86 DED3 2B71
Apple Product Security <product-security@apple.com>
Apple Product Security Notifications <product-security-noreply@lists.apple.com>
This key is due to expire on 2019-08-20.
Are you sure that you want to sign this key with your
key "My Name <me@example.com>" (0xDEADBEEFDEADBEEF)
The signature will be marked as non-exportable.
Really sign? (y/N) y
gpg: signing failed: No secret key
gpg: signing failed: No secret key
Key not changed so no update needed.
如何向此密钥添加签名以对其进行验证?