I am trying to add local signatures to a few of the public keys I have in my keyring, but using gpg --lsign-key
fails with the message "no secret key" despite the fact that gpg --sign
works. I am using a Yubikey as a smart card.
GPG shows that the secret key is not available, but there is a signing key on the attached smart card:
$ 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]
I can sign a message:
$ echo "test" | gpg --sign --armor
gpg: using "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF" as default secret key for signing
-----BEGIN PGP MESSAGE-----
[snipped signature]
-----END PGP MESSAGE-----
But I cannot --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.
How can I add a signature to this key to validate it?