Last active
September 27, 2020 17:35
-
-
Save schneefisch/c4269c299d5b650bdb2722d6439f742d to your computer and use it in GitHub Desktop.
Basic GPG usage
This file contains 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
#!/usr/bin/env bash | |
# encrypt file for specific key | |
gpg --output doc.gpg --encrypt --recipient [email protected] doc | |
# encrypt with multiple recipients | |
gpg --output doc.gpg --encrypt --recipient [email protected] --recipient [email protected] doc | |
# decrypt file | |
gpg --output doc --decrypt doc.gpg | |
# list keys | |
gpg --list-keys | |
# Export keys | |
gpg --output <your.key>.gpg --armor --export 255F00609FFFCBA4AB14DC141701DEF2B7C7C6B6 | |
gpg --output <your.key>.gpg --armor --export-secret-key 255F00609FFFCBA4AB14DC141701DEF2B7C7C6B6 | |
# Import keys | |
gpg --import ~/mygpgkey_pub.gpg | |
gpg --allow-secret-key-import --import ~/mygpgkey_sec.gpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment