gpg2 Command Examples

GNU Privacy Guard 2. See gpg for GNU Privacy Guard 1. More information: https://docs.releng.linuxfoundation.org/en/latest/gpg.html.

gpg2 --list-keys

gpg2 --encrypt --recipient {{alice@example.com}} {{path/to/doc.txt}}

gpg2 --symmetric {{path/to/doc.txt}}

gpg2 --decrypt {{path/to/doc.txt.gpg}}

gpg2 --import {{path/to/public_key.gpg}}

gpg2 --export --armor {{alice@example.com}}

gpg2 --export-secret-keys --armor {{alice@example.com}}