Cheatsheet

Below you will find a reference to the most useful commands.

Check if GPG is installed

gpg --help

List your keys

gpg --list-keys

Generate a new key pair

gpg --full-generate-key

# Choose what kind of key you want, the key size and specify an expiration date.

Export your public key

gpg --export --armor --output jane_doe_pgp.public_key.asc jane.doe@example.com

Backup and restore your key pair

gpg --export-secret-keys --output --armor jane_doe_pgp.private_key.asc jane.doe@example.com

Edit your key's expiration date

gpg --edit-key jane.doe@example.com

Change the key's passphrase

gpg passwd jane.doe@example.com