2

I am having a hard time getting GPG to work in Emacs under Windows.

The configuration options I tried:

  (setq epg-gpg-program "c:/Program Files/GNU/GnuPG/gpg2.exe")

  (setq epg-gpg-home-directory "C:/Documents and Settings/user/My Documents/.gnupg")

Upon opening a .gpg file with Emacs 25 for Windows I get the error

epg-context--make: GPG error: "no usable configuration", OpenPGP

With Emacs 24.3 the error is epa-file--find-file-not-found-function: Opening input file: Decryption failed,

What am I missing?

Do I need some special version of GnuPG?

Additional configuration options?

2

I had this problem and got it to work. Needed to spelunk through the code in epg.el and epg-config.el to determine what to fiddle with. This is what worked for me:

(custom-set-variables
 '(epg-gpg-home-directory "c:/Users/MYUSER/AppData/Roaming/gnupg")
 '(epg-gpg-program "C:/Progra~2/gnupg/bin/gpg.exe")
 '(epg-gpgconf-program "c:/progra~2/gnupg/bin/gpgconf.exe")
)

My conclusions:

  • epg.el needs gpgconf.exe to determine where all the programs are
  • also needs the home directory for gnupg
  • not sure if gpg-program also needs to be explicitly set as it is present in the output of gpgconf.exe

Give it a shot.

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.