Next: , Previous: , Up: Context Attributes   [Contents][Index]

7.4.7 Pinentry Mode

Function: gpgme_error_t gpgme_set_pinentry_mode (gpgme_ctx_t ctx,

gpgme_pinentry_mode_t mode) The function gpgme_set_pinentry_mode specifies the pinentry mode to be used.

For GnuPG >= 2.1 this option is required to be set to GPGME_PINENTRY_MODE_LOOPBACK to enable the passphrase callback mechanism in GPGME through gpgme_set_passphrase_cb.

Function: gpgme_pinentry_mode_t gpgme_get_pinentry_mode (gpgme_ctx_t ctx)

The function gpgme_get_pinenty_mode returns the mode set for the context.

Data type: enum gpgme_pinentry_mode_t

The gpgme_minentry_mode_t type specifies the set of possible pinentry modes that are supported by GPGME if GnuPG >= 2.1 is used. The following modes are supported:


Use the default of the agent, which is ask.


Force the use of the Pinentry.


Emulate use of Pinentry’s cancel button.


Return a Pinentry error No Pinentry.


Redirect Pinentry queries to the caller. This enables the use of gpgme_set_passphrase_cb whis pinentry queries redirected to gpgme.

Note: This mode requires allow-loopback-pinentry to be enabled in the gpg-agent.conf or an agent started with that option.