Changing the path to the key files in GnuPG for Windows

GnuPG for Windows 7 stores all its key files in %USERPROFILE%\AppData\Roaming\gnupg, but I wanted to change this path, say to D:\Profile\GPG, so that the files can easily be backed up.

It turns out, there are quite a few different methods to change the path: changing the default keyring location in windows.

I chose to change the config file %USERPROFILE%\AppData\Roaming\gnupg\gpg.conf and added these lines:

no-default-keyring
primary-keyring D:\Profile\GPG\pubring.gpg
secret-keyring  D:\Profile\GPG\secring.gpg
trustdb-name    D:\Profile\GPG\trustdb.gpg
keyring         D:\Profile\GPG\pubring.gpg

Then I moved all the key files to the new location, leaving only gpg.conf in the original path.

Edit: After reconsidering my backup, I set the environment variable GNUPGHOME to D:\Profile\GPG instead of changing gpg.conf. This way, all files related to GPG including the configuration are stored in one location.

Über uns Stefan

Polyglot Clean Code Developer

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax