[gpgme] change work dir

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Tue Dec 7 11:51:35 CET 2004


At Mon, 6 Dec 2004 09:48:42 +0100,
micron <micron at madlab.it> wrote:
> 
> How can I make gpgme to store/read data from a different dir instead of 
> ~/.gpg?

To werner: skip to proposal at the end if you want.

You start the program using GPGME with GNUPGHOME=..., or set the
environment variable in your program before creating the context
(current implementation: before starting the operation).

Note that semantically, we consider gpg/gpgsm to be like daemons to
gpgme.  Currently those are started by GPGME, but this is merely an
implementation detail.  You don't expect to be able to change the
environment of a webserver from a browser either, and it's
conceptually the same here.

Of course, you still want to be able to "contact differently
configured services", by whatever means.  And maybe you even want it
on a per-context basis.  Usually, you are supposed to use whatever
crypto engine configuration the user specified.  But there are
certainly applications with different requirements (incl. test suites
etc).

Now that we have versioned symbols, I don't really see a problem with
adding an implementation specific interface to set the crypto engine
configuration.  What about the following interface:

* Add a new field "config_dir" to gpgme_engine_info_t, where NULL
  means the default.

* Add

gpgme_set_engine_info (gpgme_protocol_t protocol, const char *file_name,
                       const char *config_dir);

  to allow to set the binary executable and config directory to be used.

> I've seen something into context's key listining mode but I haven't understand 
> how to use it.

I don't know what you are referring to.

Thanks,
Marcus




More information about the Gnupg-devel mailing list