Skip to content

Instantly share code, notes, and snippets.

@camsaul
Last active February 27, 2019 06:13
Show Gist options
  • Save camsaul/77eeb569357ad8486858 to your computer and use it in GitHub Desktop.
Save camsaul/77eeb569357ad8486858 to your computer and use it in GitHub Desktop.
gpg2 commands
# 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
@camsaul
Copy link
Author

camsaul commented Feb 27, 2019

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