Function: epg-start-verify

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

Signature

(epg-start-verify CONTEXT SIGNATURE &optional SIGNED-TEXT)

Documentation

Initiate a verify operation on SIGNATURE.

SIGNATURE and SIGNED-TEXT are a data object if they are specified.

For a detached signature, both SIGNATURE and SIGNED-TEXT should be set. For a normal or a cleartext signature, SIGNED-TEXT should be nil.

If you use this function, you will need to wait for the completion of epg-gpg-program by using epg-wait-for-completion and call epg-reset to clear a temporary output file. If you are unsure, use synchronous version of this function epg-verify-file or epg-verify-string instead.

Source Code

;; Defined in /usr/src/emacs/lisp/epg.el.gz
(defun epg-start-verify (context signature &optional signed-text)
  "Initiate a verify operation on SIGNATURE.
SIGNATURE and SIGNED-TEXT are a data object if they are specified.

For a detached signature, both SIGNATURE and SIGNED-TEXT should be set.
For a normal or a cleartext signature, SIGNED-TEXT should be nil.

If you use this function, you will need to wait for the completion of
`epg-gpg-program' by using `epg-wait-for-completion' and call
`epg-reset' to clear a temporary output file.
If you are unsure, use synchronous version of this function
`epg-verify-file' or `epg-verify-string' instead."
  (setf (epg-context-operation context) 'verify)
  (setf (epg-context-result context) nil)
  (if signed-text
      ;; Detached signature.
      (if (epg-data-file signed-text)
	  (epg--start context (list "--verify" "--" (epg-data-file signature)
				   (epg-data-file signed-text)))
	(epg--start context (list "--verify" "--" (epg-data-file signature)
				  "-"))
	(if (eq (process-status (epg-context-process context)) 'run)
	    (process-send-string (epg-context-process context)
				 (epg-data-string signed-text)))
	(if (eq (process-status (epg-context-process context)) 'run)
	    (process-send-eof (epg-context-process context))))
    ;; Normal (or cleartext) signature.
    (if (epg-data-file signature)
	(epg--start context (if (eq (epg-context-protocol context) 'CMS)
				(list "--verify" "--" (epg-data-file signature))
			      (list "--" (epg-data-file signature))))
      (epg--start context (if (eq (epg-context-protocol context) 'CMS)
			      '("--verify" "-")
			    '("-")))
      (if (eq (process-status (epg-context-process context)) 'run)
	  (process-send-string (epg-context-process context)
			       (epg-data-string signature)))
      (if (eq (process-status (epg-context-process context)) 'run)
	  (process-send-eof (epg-context-process context))))))