* epa.el (epa-list-keys-1): Add 'epa-list-keys property to keylist
[elisp/epg.git] / epg.el
diff --git a/epg.el b/epg.el
index d1d9160..3ba189f 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -406,6 +406,19 @@ This function is for internal use only."
        (setcdr entry value)
       (epg-context-set-result context (cons (cons name value) result)))))
 
+(defun epg-signature-to-string (signature)
+  (format "%s signature from %s %s%s"
+         (capitalize (symbol-name (epg-signature-status signature)))
+         (epg-signature-key-id signature)
+         (epg-signature-user-id signature)
+         (if (epg-signature-validity signature)
+             (format " (trust %s)"
+                     (epg-signature-validity signature))
+           "")))
+
+(defun epg-verify-result-to-string (verify-result)
+  (mapconcat #'epg-signature-to-string verify-result "\n"))
+
 (defun epg-start (context args)
   "Start `epg-gpg-program' in a subprocess with given ARGS."
   (let* ((args (append (list "--no-tty"
@@ -1161,8 +1174,8 @@ If you are unsure, use synchronous version of this function
                     (if (epg-data-file plain)
                         (list (epg-data-file plain)))))
   (if sign
-      (epg-wait-for-status context '("BEGIN_SIGNING")))
-  (epg-wait-for-status context '("BEGIN_ENCRYPTION"))
+      (epg-wait-for-status context '("BEGIN_SIGNING"))
+    (epg-wait-for-status context '("BEGIN_ENCRYPTION")))
   (if (and (epg-data-string plain)
           (eq (process-status (epg-context-process context)) 'run))
       (process-send-string (epg-context-process context)