List of commands in order:
Generate the key
gpg --gen-key
Export the key to ascii format so that it can be shown to public
gpg --export -a
> mykey.asc
cat mykey.asc
(or)
gpg -o armorkey.asc --armor --export
Create a revocation certificate now, in case u want to revoke a public key later (but don't happen to remember the passwd)
gpg -o revcert.asc --gen-revoke
cat revcert.asc
Delete a key
gpg --delete-secret-keys
gpg --delete-key
Check the fingerprint
gpg --fingerprint
List all keys that belong to you
gpg --list-key
Send it to a keyserver so that everybody can see your public key
gpg --keyserver www.keyserver.net --send-key
Sign your own key(?)
gpg --sign-key
Edit key attributes, passphrase etc.
gpg --edit-key
Encrypting and Decrypting using Gpg
---------------------------------------------------
cat message
gpg --clear-sign message
(that creates a file called message.asc)
gpg --verify message.asc
(will verify the message sender's authenticity with his public key that is present in the key ring)
gpg --output message.sig --detach-sign message
gpg --verify message.sig message
Importing a key and validating the fingerprint
---------------------------------------------------------------
Whenever you want to add a key to your keyring, import their key using
gpg --import key.asc
Validate the fingerprint with what the person shows when you sign keys (after verifying photo id of person) using:
gpg --edit-key keyid
command> fpr
Then sign the key if you trust the person's key
command> sign