Home / Notes / GnuPG Notes ========================== 1. Create a new key: $ gpg --gen-key 2. List all public keys: $ gpg --list-keys 3. List your public keys: $ gpg --list-keys 'user' 4. Get your key fingerprint: $ gpg --fingerprint 'user' 5. Export your public key in ascii: $ gpg -a --export 'user' 6. Importing a public key from a [FILE]: $ gpg --import [FILE] 7. Importing a public key from a [URL] a using curl: $ curl [URL] | gpg --import 8. Importing the public key with [id] from a [keyserver]: $ gpg --keyserver [keyserver] --recv-key [id] Reliable keyservers include: keyserver.ubuntu.com pgp.mit.edu keyserver.pgp.com If importing hangs, it could be because the firewall is blocking outgoing port 11371/TCP. It could be due to not having outbound IPV6 connectivity. If the issue is due to IPV6, add 'disable-ipv6' to ~/.gnupg/dirmngr.conf, kill any running dirmngr processes and retry importing keys. See: http://www.gnupg.org/gph/en/manual.html#AEN84 https://rvm.io/rvm/security 9. Creating a ascii signature for a [file] in a separate [signature_file]: $ gpg -asb -o [signature_file] [file] or $ gpg --sign --detach-sign --armor --output [signature_file] [file] If -o / --output [signature_file] is omitted, the signature is stored in [file].asc. 10. Verifying a signature: $ gpg --verify [signature_file] [file] If [file] is omitted, then [signature_file] must be named [file].asc