I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

  1. #+TITLE: Pinentry
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle pinentry.el :comments org
  5. #+PROPERTY: header-args:shell :tangle no
  6. #+PROPERTY: header-args :results silent :eval no-export :comments org
  7. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  8. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  9. Handle GPG pinentry within Emacs.
  10. * Setup
  11. :PROPERTIES:
  12. :header-args: :tangle ../config/gpg-agent.conf
  13. :END:
  14. When the ~gpg-agent~ loads it will read the configuration at =~/.gnupg/gpg-agent.conf=. Override the default settings to allow Emacs to function as the Pinentry application.
  15. #+begin_src conf
  16. allow-emacs-pinentry
  17. allow-loopback-pinentry
  18. #+end_src
  19. You may need to restart the ~gpg-agent~ to load the configuration without rebooting.
  20. #+begin_src shell :tangle nil
  21. gpgconf --reload gpg-agent
  22. #+end_src
  23. * Config
  24. Create the symbolic link to the configuration file.
  25. #+begin_src emacs-lisp
  26. (dotfiles/symlink "~/.emacs.d/config/gpg-agent.conf"
  27. "~/.gnupg/gpg-agent.conf")
  28. #+end_src
  29. With the ~pinentry~ package for Emacs prompts will now appear in the minibuffer. Increase the minimum prime bit size to increase performance during symmetric encryption.
  30. #+begin_src emacs-lisp
  31. (use-package pinentry
  32. :custom (epa-file-select-keys 2)
  33. (gnutls-min-prime-bits 4096)
  34. (epa-pinentry-mode 'loopback)
  35. (epa-file-encrypt-to dotfiles/public-key)
  36. (epa-file-cache-passphrase-for-symmetric-encryption t)
  37. :config (pinentry-start))
  38. #+end_src
  39. Override ~org-agenda-file-regexp~ to include =.org.gpg= files.
  40. #+begin_src emacs-lisp
  41. (unless (string-match-p "\\.gpg" org-agenda-file-regexp)
  42. (setq org-agenda-file-regexp
  43. (replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?"
  44. org-agenda-file-regexp)))
  45. #+end_src
  46. * Footnotes