Skip to content

Instantly share code, notes, and snippets.

@BenSlabbert
Created April 23, 2020 15:50
Show Gist options
  • Save BenSlabbert/f22d7d0b65fb22df7207b67982dadc36 to your computer and use it in GitHub Desktop.
Save BenSlabbert/f22d7d0b65fb22df7207b67982dadc36 to your computer and use it in GitHub Desktop.
gpg helpful commands

get fingerprint of a key

cat file.gpg | gpg --with-colons --import-options show-only --import

get fingerprints of imported keys

gpg --fingerprint

get recipients of encrypted payload

gpg --batch --list-packets file.gpg

list keys

gpg --list-keys

decrypt a file

gpg --decrypt file.json.gpg

encrypt a file

gpg --openpgp -e file.json

export a public key

gpg --export KEY_ID > my-pubkey

export private key

gpg --export-secret-keys KEY_ID > my-prv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment