Skip to content

Instantly share code, notes, and snippets.

@xguitian
Last active May 24, 2020 01:16
Show Gist options
  • Save xguitian/0df5f23cfb9636d3960ca886e081f90d to your computer and use it in GitHub Desktop.
Save xguitian/0df5f23cfb9636d3960ca886e081f90d to your computer and use it in GitHub Desktop.
GnuPG tips: Renewal
# Insert offline Master Key
# Import master key
gpg --import <path_to_master_key>
# Edit key to renew
gpg --edit-key <email/key_id>
# renew each key and subkey with:
# key <#>
# to select key and
# expire
# to change expiration date, even if it is already expired, it does _not_ matter
# export secret key
gpg --export-secret-keys --armor <email/key_id> > <key_id>.priv.asc
# export secret subkeys
gpg --export-secret-subkeys <email/key_id> > <key_id>.sub_priv.asc
# export pub keys
gpg --export --armor <email/key_id> > <key_id>.pub.asc
# Move to external storage
mv *.asc <path_to_offline_storage>
# (Optinal) Publish
gpg --send-key <key_id>
# (Optional) On other places import renewed keys
gpg --import <path_to_secret_subkey>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment