# sec rsa4096/xxxxxxxxxxxxxxxx 0000-00-00 [SC]
# yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
# uid [ultimate] My Name <me@mail.com>
# ssb rsa4096/zzzzzzzzzzzzzzzz 0000-00-00 [E]
generate key
encrypt
gpg \
--output file.txt.enc \
--encrypt \
--local-user user@example.com \
--recipient another@example.com \
file.txt
encrypt with passphrase
gpg --output file.txt.enc --symmetric file.txt
decrypt
gpg --output file.txt --decrypt file.txt.enc
sign file
gpg --sign --armor file.txt
clear sign file
gpg --clear-sign file.txt
verify file
gpg --output file.txt --verify file.txt.gpg
detach sign file
gpg --output file.txt.sig --detach-sig file.txt
detach verify file
gpg --verify file.txt.sig file.txt
list privkeys
gpg --list-secret-keys --keyid-format LONG
list pubkeys
gpg --list-public-keys --keyid-format LONG
export pubkey ( for github )
gpg --output pubkey.asc --armor --export user@example.com
export privkey
gpg --output privkey.asc --armor --export-secret-keys user@example.com
import privkey
gpg --import privkey.asc
gpg --edit-key user@example.com trust quit
change privkey passphrase
gpg --edit-key user@example.com passwd save
delete privkey
gpg --delete-secret-key user@example.com
delete pubkey
gpg --delete--key user@example.com