Detecting and flushing cached pin in gpg-agent from gpgme

Joakim Lundborg joakim.lundborg at gmail.com
Mon Jul 4 12:02:42 CEST 2016


Hi,

I'm building a GUI password manager [1] based on gpg and password-store 
[2]  formatted entries. I'm using gpgme to interact with gpg, and it 
works just fine.

Now I would like to improve my app by giving the user an indication of 
whether or not the password for the gpg key used for encrypting the 
passwords is currently cached in gpg-agent. I also would like to flush 
this cache programmatically when the user is done, to keep things 
secure.

I couldn't find APIs for this in gpgme or in gpg, unless I'm missing 
something. For flushing, it seems to be possible to use send HUP 
signals to the gpg-agent process, but this seems a bit brutal, and is 
also reported to not work [4]

I have also found the documentation for gpg-connect-agent [3], which 
allows some level of control. This documentation seems a bit incomplete 
though, for example the following, which I also found in [4] works, but 
is not documented:

echo RELOADAGENT | gpg-connect-agent

Is there a recommended way of doing any of these things?

[1] https://github.com/cortex/gopass
[2] https://www.passwordstore.org/
[3] 
https://www.gnupg.org/documentation/manuals/gnupg/Controlling-gpg_002dconnect_002dagent.html#Controlling-gpg_002dconnect_002dagent






More information about the Gnupg-devel mailing list