GPG Key management

Last modified : 1 October, 2016
  1. List ALL keys that I have gpg --list-keys

  2. List ALL secret keys that I have gpg --list-secret-keys

  3. Delete a key gpg --delete-key D39DC0E3

  4. Generate a key pair gpg --gen-key

  5. Modify a key gpg --edit-key gpg> help gpg> list

  6. Add a subkey. This should have an expiration date. gpg> addkey

  7. Change expiration gpg> expire # For primary gpg> key 1 # For a subkey gpg> expire

  8. Delete a key UID gpg> uid 1 # Selects the first uid gpg> deluid

  9. Delete a subkey gpg> key 1 # Selects the first subkey gpg> delkey

  10. List keys in a file gpg --with-fingerprint <someFile>

Doing things with your keys

  1. Sign some document. (uses your private key) gpg --clearsign AWESOME_COMMANDS.txt

  2. For a detached signature gpg --output AWESOME_COMMANDS.txt.sig --detach-sign AWESOME_COMMANDS.txt

Please add comments here:

All content on this website is licensed as Creative Commons-Attribution-ShareAlike 4.0 License. Opinions expressed are solely my own.