Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
fuss:gpg [2017/10/04 14:27] – [Encrypting and Decrypting a File using Symmetric Encryption] officefuss: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)
 +</code>
 +
 +====== Export and Backup Keys ======
 +
 +Issue:
 +<code bash>
 +gpg --list-keys
 +</code>
 +
 +to obtain the fingerprint of the keys to be exported.
 +
 +For public keys issue:
 +<code bash>
 +gpg --armor --export FINGERPRINT
 +</code>
 +
 +and for secret keys, issue:
 +
 +<code bash>
 +gpg --armor --export-secret-key FINGERPRINT
 +</code>
 +
 +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
 +</code>
 +
 +====== Export Photo ID to File ======
 +
 +In order to export the photo ID for a key with fingerprint ''FINGERPRINT'', the following command:
 +<code bash>
 +gpg --list-options show-photos --photo-viewer "cat > ./0x%k.%t" --list-key FINGERPRINT
 +</code>
 +
 +will set ''cat'' as the photo viewer and export the key to the current directory.
 +
 +====== 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>
 +/usr/bin/gpg --batch --homedir /home/was/.gnupg/ --armor --quiet --export EFA3B2C5B8DEA6BF824C82543DE933083623DDF1
 </code> </code>
  
  

fuss/gpg.1507127256.txt.bz2 · Last modified: 2017/10/04 14:27 by office

Wizardry and Steamworks

© 2025 Wizardry and Steamworks

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.