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"
14 $ gpg-agent --daemon --display "${DISPLAY}" --ttyname $(TTY) --keep-tty --keep-display --write-env-file "${HOME}/.gnupg/agent-info"
15 $ source "${HOME}/.gnupg/agent-info"
17 The `ttyname` bit will spawn the `pinentry` call in the designated
18 TTY. This avoids troublesome issues like pinentry clobbering [[Mutt]]
19 if they are both using ncurses.
21 I didn't like any of the pinentry programs available on my system, so
22 I wrote my own in [[pyassuan]].
24 When you are done with the agent, kill it with
27 $ rm -f "${HOME}/.gnupg/agent-info"
29 Since these commands are tedious to remember and type, I've wrapped
30 them in little scripts: [[gpg-agent-spawn.sh]] and
31 [[gpg-agent-kill.sh]].
33 [gpg-agent]: http://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html