0

On Mac OS Mojave:

▶ gpg --list-keys
Warning: Failed to set locale category LC_NUMERIC to en_GR.
Warning: Failed to set locale category LC_TIME to en_GR.
Warning: Failed to set locale category LC_COLLATE to en_GR.
Warning: Failed to set locale category LC_MONETARY to en_GR.
Warning: Failed to set locale category LC_MESSAGES to en_GR.
/Users/pkaramol/.gnupg/pubring.kbx
----------------------------------------------
pub   rsa2048 2019-07-04 [SC] [expires: 2021-07-03]
      1DA2A2434A38D1192A3EA4523FEF5E3944A2F025
uid           [ultimate] pkaramol <pkaramol@gmail.com>
sub   rsa2048 2019-07-04 [E] [expires: 2021-07-03]


~/Desktop
▶ ls ~/.gnupg
openpgp-revocs.d  private-keys-v1.d pubring.kbx       pubring.kbx~      trustdb.gpg

From what I understand, the public key is : /Users/pkaramol/.gnupg/pubring.kbx

How can I find out what is the corresponding private key?

2

pubring.kbx is the public key database. Private keys are in private-keys-v1.d/. As the pubring.kbx contains all public keys, there is no such thing as a "corresponding" private key.

To interact with the keyring, you will have to use the gpg command. gpg -k will list the public keys, while gpg -K lists the private keys. When a public and private key have the same ID, they are corresponding key pair.

If you need the key(s) as a file, you can use gpg --export for public keys and gpg --export-secret-keys. You can also specify the key that you like to export, or use the -a option to get an ASCII (plaintext) output.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.