1 The 2.X branch of [[GnuPG]] comes with [gpg-agent][] for caching
2 passphrases. The documentation is good, but here are my notes
3 outlining my usual usage.
5 Add the following to your `~/.bashrc` (see [[dotfiles]] for fancy
8 if [ -f "${HOME}/.gnupg/agent-info" ]; then
9 source "${HOME}/.gnupg/agent-info"
15 $ gpg-agent --daemon --write-env-file "${HOME}/.gnupg/agent-info"
16 $ echo "GPG_TTY='${GPG_TTY}'; export GPG_TTY" >> "${HOME}/.gnupg/agent-info"
17 $ source "${HOME}/.gnupg/agent-info"
19 The `GPG_TTY` bit will spawn the `pinentry` call in the designated
20 TTY. This avoids troublesome issues like pinentry clobbering [[Mutt]]
21 if they are both using ncurses.
23 I didn't like any of the pinentry programs available on my system, so
24 I wrote my own: [[pinentry.py]]. To use my script, save it somewhere
25 on your system and add a line like the following to your
26 `~/.gnupg/gpg-agent.conf`.
28 pinentry-program /path/to/pinentry.py
30 When you are done with the agent, kill it with
33 $ rm -f "${HOME}/.gnupg/agent-info"
35 [gpg-agent]: http://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html