Function: epg-verify-file

epg-verify-file is a byte-compiled function defined in epg.el.gz.

Signature

(epg-verify-file CONTEXT SIGNATURE &optional SIGNED-TEXT PLAIN)

Documentation

Verify a file SIGNATURE.

SIGNED-TEXT and PLAIN are also a file if they are specified.

For a detached signature, both SIGNATURE and SIGNED-TEXT should be string. For a normal or a cleartext signature, SIGNED-TEXT should be nil. In the latter case, if PLAIN is specified, the plaintext is stored into the file after successful verification.

Note that this function does not return verification result as t or nil, nor signal error on failure. That's a design decision to handle the case where SIGNATURE has multiple signature.

To check the verification results, use epg-context-result-for as follows:

(epg-context-result-for context 'verify)

which will return a list of epg-signature object.

Source Code

;; Defined in /usr/src/emacs/lisp/epg.el.gz
(defun epg-verify-file (context signature &optional signed-text plain)
  "Verify a file SIGNATURE.
SIGNED-TEXT and PLAIN are also a file if they are specified.

For a detached signature, both SIGNATURE and SIGNED-TEXT should be
string.  For a normal or a cleartext signature, SIGNED-TEXT should be
nil.  In the latter case, if PLAIN is specified, the plaintext is
stored into the file after successful verification.

Note that this function does not return verification result as t
or nil, nor signal error on failure.  That's a design decision to
handle the case where SIGNATURE has multiple signature.

To check the verification results, use `epg-context-result-for' as follows:

\(epg-context-result-for context \\='verify)

which will return a list of `epg-signature' object."
  (unwind-protect
      (progn
        (setf (epg-context-output-file context)
              (or plain (make-temp-file "epg-output")))
	(if signed-text
	    (epg-start-verify context
			      (epg-make-data-from-file signature)
			      (epg-make-data-from-file signed-text))
	  (epg-start-verify context
			    (epg-make-data-from-file signature)))
	(epg-wait-for-completion context)
	(unless plain
	  (epg-read-output context)))
    (unless plain
      (epg-delete-output-file context))
    (epg-reset context)))