Next: , Previous: Protocol Selection, Up: Context Attributes

7.3.2 Crypto Engine

The following functions can be used to set and retrieve the configuration of the crypto engines of a specific context. The default can also be retrieved without any particular context. See Engine Information. The default can also be changed globally. See Engine Configuration.

— Function: gpgme_engine_info_t gpgme_ctx_get_engine_info (gpgme_ctx_t ctx)

The function gpgme_ctx_get_engine_info returns a linked list of engine info structures. Each info structure describes the configuration of one configured backend, as used by the context ctx.

The result is valid until the next invocation of gpgme_ctx_set_engine_info for this particular context.

This function can not fail.

— Function: gpgme_error_t gpgme_ctx_set_engine_info (gpgme_ctx_t ctx, gpgme_protocol_t proto, const char *file_name, const char *home_dir)

The function gpgme_ctx_set_engine_info changes the configuration of the crypto engine implementing the protocol proto for the context ctx.

file_name is the file name of the executable program implementing this protocol, and home_dir is the directory name of the configuration directory for this crypto engine. If home_dir is NULL, the engine's default will be used.

Currently this function must be used before starting the first crypto operation. It is unspecified if and when the changes will take effect if the function is called after starting the first operation on the context ctx.

This function returns the error code GPG_ERR_NO_ERROR if successful, or an eror code on failure.