Skip to content

Instantly share code, notes, and snippets.

@sanyer
Last active April 12, 2022 14:15
Show Gist options
  • Save sanyer/7a83c8093732e5537bfa059c2ff50fb0 to your computer and use it in GitHub Desktop.
Save sanyer/7a83c8093732e5537bfa059c2ff50fb0 to your computer and use it in GitHub Desktop.
GPG management on MacOS

GnuPG on MacOS

Getting started

Install required software:

brew install gpg2 gnupg pinentry-mac

Configure it:

mkdir -m 700 ~/.gnupg
echo 'pinentry-program $(brew --prefix)/bin/pinentry-mac' > ~/.gnupg/gpg-agent.conf
echo 'use-agent' > ~/.gnupg/gpg.conf

Configure git:

git config --global gpg.program $(which gpg)
git config --global user.signingkey 1111111
git config --global commit.gpgsign true

Keyserver

Configure GnuPG to use keys.openpgp.org as keyserver, add this line to your gpg.conf file:

keyserver hkps://keys.openpgp.org

Refresh all your keys (e.g. new revocation certificates and subkeys):

gpg --refresh-keys

Upload your key

gpg --export your_address@example.net | curl -T - https://keys.openpgp.org

References:

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