OpenPGP 实践 – 加密密钥过期时间配置

刚刚准备向公开的仓库提交一份加密文件时, 使用PGP加密的途中发现我的 PGP Key 签名时间还没到期, 但是加密时间已经到期了

使用 kleopatra 修改后,  加密的时间依旧是过期状态, 于是有了这篇水贴

PS C:\Users\lsedog> gpg --edit-key B55EFBA80B03A0B5BAF599AF14DF4A8E8AFAECE8 # 要修改的密钥指纹
gpg (GnuPG) 2.2.8; Copyright (C) 2018 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.

sec  rsa4096/14DF4A8E8AFAECE8
     created: 2019-07-11  expires: 2019-08-31  usage: SCA
     trust: ultimate      validity: ultimate
ssb  rsa4096/B5083535CC072502
     created: 2019-07-11  expired: 2019-07-18  usage: E
[ultimate] (1). wewall <33481440+wewall@users.noreply.github.com>

gpg> key 1 # 选择要修改的密钥序号, 序号从 0 开始, 如果没有显示,密钥列表先执行 key list

sec  rsa4096/14DF4A8E8AFAECE8
     created: 2019-07-11  expires: 2019-08-31  usage: SCA
     trust: ultimate      validity: ultimate
ssb* rsa4096/B5083535CC072502
     created: 2019-07-11  expired: 2019-07-18  usage: E
[ultimate] (1). wewall <33481440+wewall@users.noreply.github.com>

gpg> expire # 修改过期时间
Changing expiration time for a subkey.
Please specify how long the key should be valid.
         0 = key does not expire
        = key expires in n days
      w = key expires in n weeks
      m = key expires in n months
      y = key expires in n years
Key is valid for? (0) 1m # 延期 1 个月, n: 阿拉伯数字, w: 周, m: 月, y: 年, 建议不要将过期时间设置 3 个月以上
Key expires at 09/01/19 19:43:28 中国标准时间
Is this correct? (y/N) y # 核对时区

sec  rsa4096/14DF4A8E8AFAECE8
     created: 2019-07-11  expires: 2019-08-31  usage: SCA
     trust: ultimate      validity: ultimate
ssb* rsa4096/B5083535CC072502
     created: 2019-07-11  expires: 2019-09-01  usage: E
[ultimate] (1). wewall <33481440+wewall@users.noreply.github.com>

gpg> save # 保存密钥

然后就可以进行愉快的玩耍了~

 

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注