system/notes/gpg.md

40 lines
597 B
Markdown

# Generate key
```sh
gpg --full-generate-key
```
# Get Public Key
```sh
gpg --list-keys
gpg --armor --export <ID>
```
# GnuPG Backup
References:
- https://www.howtogeek.com/816878/how-to-back-up-and-restore-gpg-keys-on-linux/
## Export keys
```sh
gpg --export --export-options backup --output public.gpg
gpg --export-secret-keys --export-options backup --output private.gpg
gpg --export-ownertrust > trust.gpg
```
## Import keys
```sh
gpg --import public.gpg
gpg --import private.gpg
gpg --import-ownertrust trust.gpg
```
## Verify
```sh
gpg --list-secret-keys --keyid-format long
```