Using gpg commands

Create new key-pair with:

$ gpg --gen-key

Export key to ascii-file:

$ gpg --export -a -o public_key.txt hugo@world.com

Import a key:

$ gpg --import public_key.txt

List keys:

$ gpg --list-keys
$ gpg --list-sigs
$ gpg --fingerprint
$ gpg --list-secret-keys

Delete keys:

$ gpg --delete-key UID 
$ gpg --delete-secret-key UID

Edit keys:

$ gpg --edit-key UID

Signing keys: edit key, use "sign" command. trust values:

      1 = Don't know
      2 = I do NOT trust
      3 = I trust marginally
      4 = I trust fully

You can have several uid for one key: edit key, use "adduid", "deluid", "uid" to edit uids

Encrpyt:

$ gpg --encrypt Recipient [data]

Decrypt:

$ gpg --decrypt Recipient [data]

Signing:

$ gpg --clearsign [Data]

Signing with seperate file

$ gpg --detach-sign [Data]

Sign and encrypt:

$ gpg [-u Sender] [-r Recipient] [--armor] --sign --encrypt [Data]

Verify data:

$ gpg [--verify] [Data]