aptitude install gnupg

Important: keys are stored in ~/.gnupg, ensure to back up this folder.

Generate a pair of keys (public + private)

gpg --gen-key

Useful commands

List public keys:

gpg --list-keys

List private keys:

gpg --list-secret-keys

Export a public key to a file:

gpg --armor --export KEY_ID > KEY_ID.key

Export a private key to a file:

gpg --armor --export-secret-keys KEY_ID > KEY_ID.skey

Import a public or private key:

gpg --import KEY_ID.key

Remove a public and/or private key:

gpg --delete-secret-and-public-keys KEY_ID