我运行gpg --list-keys
它并向我显示了钥匙圈中的钥匙:
/home/kshitiz/.gnupg/pubring.gpg
--------------------------------
pub 4096R/8F64D7E0 2015-02-18
uid Kshitiz Sharma (http://ksharma.in) <[email protected]>
sub 4096R/C87EAA9F 2015-02-18
sub 4096R/B63EFB4D 2015-02-18
我删除了我的密钥:
$ gpg --delete-secret-key [email protected]
sec 4096R/8F64D7E0 2015-02-18 Kshitiz Sharma (http://ksharma.in) <[email protected]>
Delete this key from the keyring? (y/N) y
This is a secret key! - really delete? (y/N) y
然后再次列出键gpg --list-keys
。输出相同:
/home/kshitiz/.gnupg/pubring.gpg
--------------------------------
pub 4096R/8F64D7E0 2015-02-18
uid Kshitiz Sharma (http://ksharma.in) <[email protected]>
sub 4096R/C87EAA9F 2015-02-18
sub 4096R/B63EFB4D 2015-02-18
为什么密钥没有8F64D7E0
被删除?
奇怪的是,gpg --delete-secret-key
再次运行说没有找到密钥:
gpg: key "[email protected]" not found: eof
gpg: [email protected]: delete key failed: eof
答案1
GPG 在不同的地方存储公钥和私钥。
你输出 mentions :/home/kshitiz/.gnupg/pubring.gpg
它包含“公共”密钥(酒吧戒指)
如果您想列出私钥,您必须使用开关--list-secret-keys
。
至于为什么密钥 8F64D7E0 没有被删除,那是因为你要求只销毁私钥。由于删除私钥不会影响公钥,因此不需要级联删除。