17

In the .gnupg directory there are these files,

(alpha numeric)*.key e.g. 1EFA02EFP.key 

What are they? Are these v1 gpg key files? And how do i import these?

And where are the private keys held? I see a sshcontrol, tofu.db sqlite3 file, the trustdb.gpg, and pubring.kbx, pubring.kbx~. But where are the private keys written to?

1 Answer 1

13

From man gpg of GPG version 2.2.12 (emphasis mine):

--secret-keyring file

This is an obsolete option and ignored. All secret keys are stored in the ‘private-keys-v1.d’ directory below the GnuPG home directory.

So, those *.key files are the actual, current-version secret keys, also known as private keys. In older GPG versions, there used to be secring.gpg corresponding to pubring.gpg, and in GPG 2.1, the private key storage format was changed from a keyring file to a directory of separate key files. At the same time, the public key storage format was changed from a .gpg keyring file to a .kbx keybox file.

To import a secret key to another user's GPG 2.x environment, apparently gpg --import secret.key does the right thing. The tricky part will probably be getting that file securely to the other user.

1
  • 7
    The second part of the question was how to import those private-keys-v1.d/*.key files into another users keyring without gpg exporting them. Commented Oct 23, 2019 at 18:32

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.