GPG Key management
Last modified : 1 October, 2016
-
List ALL keys that I have
gpg --list-keys
-
List ALL secret keys that I have
gpg --list-secret-keys
-
Delete a key
gpg --delete-key D39DC0E3
-
Generate a key pair
gpg --gen-key
-
Modify a key
gpg --edit-key gpg> help gpg> list
-
Add a subkey. This should have an expiration date.
gpg> addkey
-
Change expiration
gpg> expire # For primary gpg> key 1 # For a subkey gpg> expire
-
Delete a key UID
gpg> uid 1 # Selects the first uid gpg> deluid
-
Delete a subkey
gpg> key 1 # Selects the first subkey gpg> delkey
-
List keys in a file
gpg --with-fingerprint <someFile>
Doing things with your keys
-
Sign some document. (uses your private key)
gpg --clearsign AWESOME_COMMANDS.txt
-
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.