Skip to content

Instantly share code, notes, and snippets.

@cota
Created December 1, 2019 23:10
Show Gist options
  • Save cota/7d4e3e111343133f7aab38082c1898b9 to your computer and use it in GitHub Desktop.
Save cota/7d4e3e111343133f7aab38082c1898b9 to your computer and use it in GitHub Desktop.
export/import a GPG key
# Export a specific `foo@bar.com` key in an encrypted (i.e. password-protected) file `mykey.sec.asc`
gpg --armor --export-secret-keys foo@bar.com | gpg --armor --symmetric --output mykey.sec.asc
# Import the key in `mykey.sec.asc`. `gpg` will ask for the password used when exporting.
gpg --no-use-agent --output - mykey.sec.asc | gpg --import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment