我可以为我现有的 GPG 密钥添加一个到期日期吗?

Mne*_*nth 6 encryption gnupg

我有一个 GPG 密钥。此密钥无限有效。我最近想,这不是最好的主意。这就是为什么我的问题:我可以为现有的 GPG 密钥添加到期日期吗?或者是我唯一的选择,创建一个新的密钥?

小智 12

如果您从命令行执行此操作,则可以使用gpg:-

[andys@daedalus ~]$ gpg --edit-key 0xA762A666

<...>

Command> expire
Changing expiration time for the primary key.
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 10y
Key expires at Mon 14 Dec 2020 23:49:53 GMT
Is this correct? (y/N) y

You need a passphrase to unlock the secret key for
user: "Andy Smith <andy.smith@netprojects.org.uk>"
4096-bit RSA key, ID A762A666, created 2009-05-08
Run Code Online (Sandbox Code Playgroud)

输入您的密码,保存密钥,您就完成了。您可能还想将密钥重新上传到您之前将密钥上传到的任何密钥服务器。


nhi*_*kle 2

是的,您可以编辑它。该过程取决于您使用的软件。我在 Windows 上使用 GPGkeys,您只需右键单击您的私钥,然后选择edit > expiration date。您的软件中可能有类似的方法。您还可以随时手动撤销密钥。