gpgme and static keys

Marcus Brinkmann marcus.brinkmann at
Sun Jul 17 14:34:05 CEST 2005

At Fri, 15 Jul 2005 18:23:07 +0300,
Radu Spineanu <radus at> wrote:
> I want to create a program (using gpgme) that encrypts small ammounts of
> data using a static public key.
> I read the documentation and all i found were examples using local
> keyrings, however that's too much for what i need.
> The user should dump his public key in a directory, and the program
> would detect it and use that to encrypt the data, without importing it.
> Is something like this possible ?

No.  But you can create a new temporary home directory for gnupg (like
the user's .gnupg directory), reconfigure the engine with
gpgme_set_engine (only available in the CVS version of GPGME), and
then import the key.  After you are done using this configuration, you
could clear the temporary home directory.  Of course, this is not
particularly efficient, so if you have lots of operations, you
probably want to keep the home directory around.


More information about the Gnupg-devel mailing list