Detecting and flushing cached pin in gpg-agent from gpgme

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


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 

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?


More information about the Gnupg-devel mailing list