This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
fuss:gpg [2017/10/04 14:27] – [Encrypting and Decrypting a File using Symmetric Encryption] office | fuss:gpg [2023/09/22 11:20] (current) – [Export Photo ID to File] office | ||
---|---|---|---|
Line 122: | Line 122: | ||
<code bash> | <code bash> | ||
export GPG_TTY=$(tty) | export GPG_TTY=$(tty) | ||
+ | </ | ||
+ | |||
+ | ====== Export and Backup Keys ====== | ||
+ | |||
+ | Issue: | ||
+ | <code bash> | ||
+ | gpg --list-keys | ||
+ | </ | ||
+ | |||
+ | to obtain the fingerprint of the keys to be exported. | ||
+ | |||
+ | For public keys issue: | ||
+ | <code bash> | ||
+ | gpg --armor --export FINGERPRINT | ||
+ | </ | ||
+ | |||
+ | and for secret keys, issue: | ||
+ | |||
+ | <code bash> | ||
+ | gpg --armor --export-secret-key FINGERPRINT | ||
+ | </ | ||
+ | |||
+ | which will create an ASCII armored export for both public and secret keys. | ||
+ | |||
+ | Alternatively to export both at the same time in order to create a backup, issue: | ||
+ | <code bash> | ||
+ | gpg --armor --export-secret-keys --export-options export-backup FINGERPRINT | ||
+ | </ | ||
+ | |||
+ | ====== Export Photo ID to File ====== | ||
+ | |||
+ | In order to export the photo ID for a key with fingerprint '' | ||
+ | <code bash> | ||
+ | gpg --list-options show-photos --photo-viewer "cat > ./ | ||
+ | </ | ||
+ | |||
+ | will set '' | ||
+ | |||
+ | ====== Exporting from Batch Scripts ====== | ||
+ | |||
+ | One of the most common problems when exporting PGP keys from batch script is that the home directory for PGP is not known. The command line can be changed in order to include the home directory and other switches that will ensure that the PGP command can be run from batch scripts. | ||
+ | |||
+ | For example, the Wizardry and Steamworks PGP key is exported daily via a cron script using the following command: | ||
+ | <code bash> | ||
+ | / | ||
</ | </ | ||
For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.