我最近需要发布我的 PGP 密钥。然而导出的时间非常长:
$ gpg2 --list-secret-keys --keyid-format LONG
/home/user/.gnupg/pubring.kbx
-----------------------------
sec rsa4096/51DAE9B7C1AE9161 2015-06-17 [SCA] [expires: 2023-04-21]
97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161
uid [ultimate] NicoHood <removed>
uid [ultimate] N <removed>
uid [ultimate] NNNNN <removed>
uid [ultimate] NNNNN <removed>
uid [ultimate] _____ <removed>
uid [ultimate] NicoHood <removed>
uid [ultimate] NicoHood <gremoved>
uid [ultimate] _____ <removed>
uid [ultimate] _____ <removed>
uid [ultimate] NNNNN <removed>
uid [ultimate] NicoHood <removed>
uid [ultimate] NicoHood <removed>
uid [ultimate] NicoHood <removed>
ssb rsa4096/E441069FE948D07A 2015-06-17 [E] [expires: 2023-04-21]
$ gpg2 --armor --export 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161 | wc -l
583
- 是否可以选择仅输出具有一个身份的密钥?
- 是否可以将输出缩短到少于 500 行? (也许有或没有上面的想法)
- 我该如何修复这些丑陋的名字?
答案1
您可以指定导出选项,包括生成非常小的文件的最小导出:
gpg2 --armor --export --export-options export-minimal 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161
您可以使用过滤器--export-filter
来过滤 uids keep-uid
:
... --export-filter keep-uid="uid =~ <email>"
修复其他任何问题通常涉及编辑密钥。