Oct 09

GPG cheat sheet

GPG quick memo

I always forget my GPG commands so I decided to make a quick cheat sheet đŸ™‚

Create a key (RSA 2048)

gpg --gen-key

List existing keys

gpg --list-keys

Export public key (binary)

gpg --output fmo_public.key --export me@email.com

Export public key (ascii)

gpg --armor --export me@email.com fmo_public_asc.key

Backup public key (ascii)

gpg -ao fmo_public_asc.key --export me@email.com

Backup private key

gpg -ao fmo_private_asc.key --export-secret-keys me@email.com

Restore GPG key

Private first

gpg --import fmo_private_asc.key

then Public

gpg --import fmo_public_asc.key

Delete a key

gpg –delete-secret-and-public-key

Generate revocation key

gpg --output fmo_revoke.key --gen-revoke me@email.com

Revoke a key

gpg --import fmo_revoke.key