Function: epg-context-set-passphrase-callback

epg-context-set-passphrase-callback is an autoloaded and byte-compiled function defined in epg.el.gz.

Signature

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

Documentation

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.

Source Code

;; Defined in /usr/src/emacs/lisp/epg.el.gz
(defun 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."
  ;; (declare (obsolete setf "25.1"))
  (setf (epg-context-passphrase-callback context)
        (if (functionp passphrase-callback)
	    (list passphrase-callback)
	  passphrase-callback)))