Last active
February 27, 2019 06:13
-
-
Save camsaul/77eeb569357ad8486858 to your computer and use it in GitHub Desktop.
gpg2 commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# export a public key | |
gpg2 --export --armor $KEY(S) | |
# import a public key | |
gpg2 --import $INPUT_FILE | |
# encrypt file | |
gpg2 --encrypt --armor --local-user $SENDER --recipient $RECIPIENT --output $OUTPUT_FILE $INPUT_FILE | |
# create detached signature for file | |
gpg2 --armor --detatch-sign --local-user $SENDER $FILE | |
# decrypt file | |
gpg2 --decrypt --output $OUTPUT_FILE $INPUT_FILE | |
# set the default key | |
echo "default-key $KEY" >> ~/.gnupg/gpg.conf |
Setup git to use gpg
git config --global commit.gpgsign true
git config --global user.signingkey <long-fingerprint>
Export a secret key
gpg2 --export-secret-key --armor <key>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GPG keys for which you have both a public and private key