All GPG keys are stored in the "keyring", which is at ~/.gnupg
or %AppData%/gnupg
. Running gpg --version
will show the path being used.
The usual way of sharing keys is to export them to a file...
gpg -a --export [email protected] > mypubkey.asc
...or to publish it on a keyserver and give others the key ID along with the fingerprint:
gpg --keyserver pool.sks-keyservers.net --send-keys [email protected]
gpg --keyid-format 0xlong --fingerprint [email protected]
The above can also be done using the Enigmail's Key Management window.
When making backups, be aware that the storage format can change over time, and only the export format is well-defined and stable. In particular, GnuPG 2.1 has a very different storage format from GnuPG 1.x, and even in-place upgrades tend to go wrong.
So you should back up the actual keyring files (pubring, secring, trustdb) to make restoring easier (as they also contain personal preferences such as trust levels), however, you must also export your private keys via the --export-secret-keys
option:
gpg --export-secret-keys [email protected] > mysecretkey.asc