修改gpg默认签名key

2024-10-10 12:54:07 浏览数 (5)

一盏一直亮着的灯,你不会去注意,但是如果它一亮一灭,你就会注意到。——刘墉

测试方式如下:

代码语言:javascript复制
Github-Id-VampireAchao:Downloads achao$ echo "Test" > test.txt
Github-Id-VampireAchao:Downloads achao$ gpg --sign test.txt
gpg: 使用 “AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE” 作为默认签名用私钥
Github-Id-VampireAchao:Downloads achao$ gpg --verify test.txt.gpg
gpg: 签名建立于 二 10/ 8 23:49:20 2024 CST
gpg:               使用 RSA 密钥 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE
gpg: 完好的签名,来自于 “achao (for apache StreamPark release create at 20240906) <achao@apache.org>” [绝对]
Github-Id-VampireAchao:Downloads achao$ gpg --sign -v test.txt
gpg: enabled compatibility flags:
gpg: 使用 pgp 信任模型
gpg: 使用 “AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE” 作为默认签名用私钥
文件‘test.txt.gpg’已存在。 是否覆盖?(y/N) y
gpg: 正在写入‘test.txt.gpg’
gpg: RSA/SHA256 签名来自:“DDDDDDDDDDDDE achao (for apache StreamPark release create at 20240906) <achao@apache.org>”

这里如果想要修改默认的,可以修改这个文件:

代码语言:javascript复制
Github-Id-VampireAchao:Downloads achao$ cat ~/.gnupg/gpg.conf
auto-key-retrieve
no-emit-version
default-key AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE

查看所有的key:

代码语言:javascript复制
Github-Id-VampireAchao:Downloads achao$ gpg --list-secret-keys
/Users/achao/.gnupg/pubring.kbx
-------------------------------
sec   rsa4096 2023-09-07 [SC] [有效至:2027-09-07]
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7
uid             [ 绝对 ] VampireAchao <achao1441470436@gmail.com>
ssb   rsa4096 2023-09-07 [E] [有效至:2027-09-07]

sec   rsa4096 2024-09-05 [SC]
      AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE
uid             [ 绝对 ] achao (for apache StreamPark release create at 20240906) <achao@apache.org>
ssb   rsa4096 2024-09-05 [E]

Github-Id-VampireAchao:Downloads achao$ gpg --list-keys
/Users/achao/.gnupg/pubring.kbx
-------------------------------
pub   dsa2048 2010-08-19 [SC] [过期于:2024-05-11]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 过期 ] GPGTools Team <team@gpgtools.org>
uid             [ 过期 ] [jpeg image of size 6329]

pub   rsa4096 2020-05-04 [SC] [过期于:2024-05-03]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 过期 ] GPGTools Support <support@gpgtools.org>

pub   rsa4096 2023-09-07 [SC] [有效至:2027-09-07]
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7
uid             [ 绝对 ] VampireAchao <achao1441470436@gmail.com>
sub   rsa4096 2023-09-07 [E] [有效至:2027-09-07]

pub   ed25519 2022-05-27 [SC] [过期于:2024-05-27]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 过期 ] VampireAchao <achao1441470436@gmail.com>

pub   rsa4096 2021-11-29 [SC]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 未知 ] Gitee (Gitee web-flow commit signing.) <noreply@gitee.com>
sub   rsa4096 2021-11-29 [E]

pub   rsa4096 2022-12-09 [SC]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 未知 ] benjobs (benjobs apache keys) <benjobs@apache.org>
sub   rsa4096 2022-12-09 [E]

pub   rsa4096 2023-05-01 [SC]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 未知 ] muchunjin (for apache StreamPark release create at 20230501) <muchunjin@apache.org>
sub   rsa4096 2023-05-01 [E]

pub   rsa4096 2023-06-21 [SC]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 未知 ] muchunjin (for apache StreamPark release create at 20230621) <muchunjin@apache.org>
sub   rsa4096 2023-06-21 [E]

pub   rsa4096 2023-10-24 [SC]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 未知 ] gongzhongqiang (for apache StreamPark release create at 20231024) <gongzhongqiang@apache.org>
sub   rsa4096 2023-10-24 [E]

pub   rsa4096 2024-01-03 [SC]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 未知 ] wangqingrong (for apache StreamPark release 2.1.3 create at 20240103) <monreid@apache.org>
sub   rsa4096 2024-01-03 [E]

pub   rsa4096 2024-04-21 [SC]
      85E85E85E85E85E85E85E85E85E85E85E85E85EE44
uid             [ 绝对 ] lvshaokang (for apache StreamPark release create at 20240421) <lvshaokang@apache.org>
sub   rsa4096 2024-04-21 [E]

pub   rsa4096 2024-09-05 [SC]
      AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE
uid             [ 绝对 ] achao (for apache StreamPark release create at 20240906) <achao@apache.org>
sub   rsa4096 2024-09-05 [E]

Github-Id-VampireAchao:Downloads achao$

0 人点赞