gpgme: two separated contexts

Marcus Brinkmann marcus.brinkmann at
Tue Jun 20 23:58:31 CEST 2006

At Tue, 20 Jun 2006 10:18:35 +0200,
Björn Mayer <info at> wrote:
> Hi folks,
> I just can't find out how I can create two separated contexts out of one  
> GPG engine with the help of gpgme, so that I can import keys and delete  
> keys in one context without affecting the other one!? Is this actually  
> possible or is there always only one context for one GPG engine? If it is  
> possible, how can I reaccess those contexts after having them closed?
> I'm really thankfull about every single hint!!

Contexts don't separate backend engines, they only capture the
internal GPGME state of a crypto operation.  If one crypto operation
modifies the backend engine state, that can be observed by another
context using the same backend engine state.  Remember that GPGME is
only a layer around the backend, it does not capture any state of the
backend itself.

If you actually want separate backend states, you need to create a new
home directory for gnupg, and populate it with the state you want it
to have somehow (manually).  Then you can use the "set engine info"
operation to configure the context to actually make use of that second
home dir.


More information about the Gnupg-devel mailing list