epg-context-set-passphrase-callback

epg-context-set-passphrase-callback is a compiled Lisp function in `epg.el'.

(epg-context-set-passphrase-callback CONTEXT PASSPHRASE-CALLBACK)

Set the function used to query passphrase.

PASSPHRASE-CALLBACK is either a function, or a cons-cell whose
car is a function and cdr is a callback data.

The function gets three arguments: the context, the key-id in
question, and the callback data (if any).

The callback may not be called if you use GnuPG 2.x, which relies
on the external program called `gpg-agent' for passphrase query.
If you really want to intercept passphrase query, consider
installing GnuPG 1.x _along with_ GnuPG 2.x, which does passphrase
query by itself and Emacs can intercept them.