1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-10-30 18:17:57 +01:00
tldr/pages/common/gpg2.md
2019-06-03 22:02:45 +01:00

931 B

gpg

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

  • List imported keys:

gpg2 --list-keys

  • Encrypt a specified file for a specified recipient, writing the output to a new file with .gpg appended:

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

  • Encrypt a specified file with only a passphrase, writing the output to a new file with .gpg appended:

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

  • Decrypt a specified file, writing the result to the standard output:

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

  • Import a public key:

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

  • Export the public key of a specified email address to the standard output:

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

  • Export the private key with a specified email address to the standard output:

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