2023-03-17 12:21:12 +03:00
|
|
|
# Generate key
|
|
|
|
|
|
|
|
```sh
|
|
|
|
gpg --full-generate-key
|
|
|
|
```
|
|
|
|
|
2024-02-27 19:09:22 +03:00
|
|
|
# Get Public Key
|
|
|
|
|
|
|
|
```sh
|
|
|
|
gpg --list-keys
|
|
|
|
gpg --armor --export <ID>
|
|
|
|
```
|
|
|
|
|
2023-03-17 12:21:12 +03:00
|
|
|
# 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
|
|
|
|
```
|