4

I'm having a heck of a time finding the GPG keys created by Kleopatra on Windows 10 professional. The first key is used by Thunderbird and Enigmail. The second key is used by Git for commit signing. The keys display fine in the Kleopatra GUI.

The Thunderbird and Enigmail keys work fine. I've been signing, encrypting and verifying all week. The Git keys are new but I have not been able to use them because I don't know where they are located.

Kleopatra does not display or have a setting for file paths, like gpg.conf or secring.gpg. The closest I have found is Kleopatra key details that merely says "local".

The keys are not located in ~/.gnupg (from a Git Bash terminal):

DESKTOP-P8D3DKA MINGW64 ~/.gnupg
$ gpg --list-keys

DESKTOP-P8D3DKA MINGW64 ~/.gnupg
$

The keys are not located in %APPDATA% as detailed by Where are my GnuPG keys stored? and Where is the keyring location in windows XP.

DESKTOP-P8D3DKA MINGW64 ~/.gnupg
$ find "C:\\Users\\Jeff W\\AppData" -name '*.gpg'

C:\Users\Jeff W\AppData/Roaming/gnupg/trustdb.gpg

DESKTOP-P8D3DKA MINGW64 ~/.gnupg
$

I also put Kleopatra under Process Explorer and I did not see it accessing keyrings (even though it displays over 220 keys from company employees).

My first question is, why is the configuration information hidden, and not prominently displayed? (This has been a problem for over 10 years. There has been ample opportunity to fix it).

My second question is, where are the Kleopatra keys? (I want to move the commit signing key into ~/.gnupg so Git can use it).


May be helpful:

$ gpg --version
gpg (GnuPG) 1.4.22
...

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

$ ls ~/.gnupg/
gpg.conf  pubring.gpg  secring.gpg  trustdb.gpg
jww
  • 12,722

1 Answers1

5

Tracing with Process Monitor reveals that Kleopatra talks to a gpg-agent.exe via TCP. That's why you don't see Kleopatra accessing the key ring itself.

All Gpg4win tools look for the GnuPG home directory in %APPDATA%\GnuPG as described in the Gpg4win documentation, chapter Personal user settings. So, this is no a secret. However the expansion given as example applies to Win7. In Win10, this now translates to C:\Users\<user>\AppData\Roaming\gnupg.

MinGW which is used by git has its own ecosystems and unfortunately the gpg which comes wtih MinGW uses a different home directory. As you see from your printout, that gpg's home directory is ~/.gnupg which translates to C:\Users\<user>\.gnupg under Win10.

While it is possible to tweak gpg to use a different home directory, IMHO the easisest solution is to let git use the gpg.exe which comes with Gpg4win instead of the one bundled with MinGW. This is described in Configure GPG for Git on Windows:

git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe"
Adrian W
  • 166