GPG

Revoke ID

  1. Edit your key with gpg --edit-key <KEY_ID>
  2. Select the sub-key to revoke with uid <ID>
  3. Revoke it with revuid
  4. Save your changes with save
  5. Publish your updated key with gpg --send-keys <KEY_ID>

Retrieve ID

$ gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 843938DF228D22F7B3742BC0D94AA3F0EFE21092

Import public key

gpg --import-key rms-pubkey.asc

Add ID

gpg --edit-key <ID>
adduid

Export public key

gpg --armor --export 4891B39B3AA3244E01DB2485F1C91E514AF8DE5F

Export secret key

gpg --armor --export-secret-key 4891B39B3AA3244E01DB2485F1C91E514AF8DE5F

Symmetric encrypt

gpg --output doc.gpg --symmetric doc

Symmetric decrypt

gpg --output doc --decrypt doc.gpg

Password from password file

gpg --passphrase-fd 0 --pinentry-mode loopback $ARGS < "$PASS_FILE"