« Back to Index

[Extend expired GPG key]

View original Gist on GitHub

Tags: #gpg #keys #encryption

Extend expired GPG key.sh

# list the public keys and their IDs
gpg --list-keys

# select public key ID for expired key you wish to extend
gpg --edit-key <...>

# you're dropped into gpg interactive shell, here you'll execute commands (e.g. type "help")
gpg> list

# set new expiry for the primary key (which is the default and is equivalent to "key 0")
gpg> expire

# you can also select the subkey (you'll see an asterisk now next to the subkey)
gpg> key 1

# set new expiry for the subkey
gpg> expire

# now exit the interactive shell and make sure to save your changes
gpg> quit

# alternatively you can save before you quit
gpg> save