Registry - Key location

I have installed gpg4win 2.1.0.
How can I change the key location folder ? I am looking at the registry but cannot find the key. And can’t find any option in the UI.

Can someone faced this before ? thx

I am looking at this problem also.
In version 2.3x, The keyrings are saved USERS(account)\AppData\Roaming\gnpug

Files: secring.gpg

What a horrible place to store them. If profile gets rebuilt, this data is lost. In older versions, an Environment variable GNUPGHOME could control this, but this feature no longer works.

There does not appear to be a registry key controlling this.

Tim (and David, if you’re still wondering),

The location which GPG uses for the keyfiles can be changed in the following way:

  1. Move the “pubring.gpg” and “secring.gpg” files to whatever location you want to use (for example: “D:\example”).
  2. Open a file explorer window and navigate to “C:\Users[Your User Name]\AppData\Roaming\gnupg” (*See note).
  3. Open the file named “gpg.conf” with a text editor, such as Notepad.
  4. Directly under the last line of text, type the following, substituting the example location with the one you used in step 1:

keyring D:\example\pubring.gpg
secret-keyring D:\example\secring.gpg

  1. Save and close the file.

GPG and, consequently, GPG4Win will now use the specified locations for the keyrings. NB that this works with a removable drive (as long as the same drive letter is assigned each time it is connected) or, for example, with an encrypted file mounted as the target drive. You may want to close Kleopatra and/or GPA before performing the above actions and restart them afterward to make sure they use the new location.

There is also a “trustdb-name” option, but I have not used it, and therefore cannot verify that it will work in the same way to relocate the trust database. The GPG option index (linked at the bottom of this reply) states that the “secret-keyring” option is obsolete, but I have found that it still works perfectly well. I did move the “private-keys-v1.d” file to the new location as well, just to be sure. If the keyring files do not exist in the target location, GPG should create new (empty) files automatically the first time it is invoked.

*Note: The “AppData” file is hidden by default. You may need to enable the “show hidden files” option in Windows File Explorer options under the “view” tab. Alternatively, you can type the address of the file directly into the address bar.

For more options, see:

I hope that helps.

Sean C.