gpg
Contents
Usage
- Create gpg
gpg --gen-key
- list gpg
gpg --list-keys
,gpg --list-keys --keyid-format SHORT
- export public key
gpg --export key-id -o file.key
,--armor
means use assic txt, not binary file. key-id is the email address or the number in pub line - import key
gpg --import file.key
- encrypt file
gpg --encrypt -r key-id file
- decrypt file
gpg --decrypt file
Issues
- Why it shows ‘unknown’ in uid?
It’s because gpg do not trust if the email address own the public key. We can
use gpg --edit-key F1C68AB4
to update it to ultimate
.
Reference: How to use PGP
Author Hangbin Liu
LastMod 2020-06-09 (93a7471)