Passphrase Callback
-------------------
- Data type: const char *(*GpgmePassphraseCb)(void *HOOK, const char
*DESC, void **R_HD)
The `GpgmePassphraseCb' type is the type of functions usable as
passphrase callback function.
The string DESC contains a test usable to be displayed to the user
of the application. The function should return a passphrase for
the context when invoked with DESC not being `NULL'.
The user may store information about the resources associated with
the returned passphrase in *R_HD. When the passphrase is no longer
needed by GPGME, the passphrase callback function will be called
with DESC being NULL, and R_HD being the same as at the first
invocation.
- Function: void gpgme_set_passphrase_cb (GpgmeCtx CTX,
GpgmePassphraseCb PASSFUNC, void *HOOK_VALUE)
The function `gpgme_set_passphrase_cb' sets the function that is
used when a passphrase needs to be provided by the user to
PASSFUNC. The function PASSFUNC needs to implemented by the user,
and whenever it is called, it is called with its first argument
being HOOK_VALUE. By default, no passphrase callback function is
set.
Not all crypto engines require this callback to retrieve the
passphrase. It is better if the engine retrieves the passphrase
from a trusted agent (a daemon process), rather than having each
user to implement their own passphrase query.
The user can disable the use of a passphrase callback function by
calling `gpgme_set_passphrase_cb' with PASSFUNC being `NULL'.