Since GnuPG 2.1 (https://www.gnupg.org/faq/whats-new-in-2.1.html), private keys of GnuPG are stored in the private-keys-v1.d
subdirectory. After experimenting with key creation etc., I found that I have several *.key
files in this directory:
$ ls .gnupg/private-keys-v1.d
xxxxxxxxxxxxxxxxxxxxxxxxxxxx.key
yyyyyyyyyyyyyyyyyyyyyyyyyyyy.key
zzzzzzzzzzzzzzzzzzzzzzzzzzzz.key
...
The file names (x+, y+ and z+) looks like fingerprints etc., but are not equal to any of my existing public keys. How can I find which key file in this directory belongs to which key visible with gpg --list-keys
?
Private keys and personal certificates are stored in keystores. Public keys and CA certificates are stored in truststores. A truststore is a keystore that by convention contains only trusted keys and certificates.
The private GPG keys are encrypted and stored in the secret keyring, and public keys are maintained with certificates attesting to their trustworthiness in the public keyring. You can use the public key for the data encryption, and that encrypted data will be decrypted using the Private key.
A private key is typically a long, randomly or pseudo-randomly generated sequence of bits that cannot be easily guessed. The complexity and length of the private key determine how easily an attacker can execute a brute-force attack, where they try out different keys until the right one is found.
pkr (public keyring) and secring. skr (private keyring) file in the default keyring location. For Windows this is in the Documents>PGP folder. This article will use [ ] to identify information that you will need to enter that is specific to your individual keys.
Use --with-keygrip
option when listing your keys.
gpg --list-secret-keys --with-keygrip
gpg --list-keys --with-keygrip
You can compare than the output with the content of the private-keys-v1.d
subdirectory, where the keys are named like <keygrip>.key
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With