* epg.el (epg-new-signature-to-string): New function.
authorueno <ueno>
Mon, 1 May 2006 03:49:17 +0000 (03:49 +0000)
committerueno <ueno>
Mon, 1 May 2006 03:49:17 +0000 (03:49 +0000)
ChangeLog
epg.el

index 6b618e2..57a8402 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
        (epg-new-signature-type-alist): New variable.
        (epg-make-new-signature): New object epg-new-signature.
        (epg-status-SIG_CREATED): Set epg-new-signature object.
+       (epg-new-signature-to-string): New function.
 
 2006-04-30  Daiki Ueno  <ueno@unixuser.org>
 
diff --git a/epg.el b/epg.el
index d2ba8ec..6249909 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -658,6 +658,24 @@ This function is for internal use only."
   "Convert VERIFY-RESULT to a human readable string."
   (mapconcat #'epg-signature-to-string verify-result "\n"))
 
+(defun epg-new-signature-to-string (new-signature)
+  "Convert NEW-SIGNATURE to a human readable string."
+  (concat
+   (cond ((eq (epg-new-signature-type new-signature) 'detached)
+         "Detached signature ")
+        ((eq (epg-new-signature-type new-signature) 'clear)
+         "Clear text signature ")
+        (t
+         "Signature "))
+   (cdr (assq (epg-new-signature-pubkey-algorithm new-signature)
+             epg-pubkey-algorithm-alist))
+   "/"
+   (cdr (assq (epg-new-signature-digest-algorithm new-signature)
+             epg-digest-algorithm-alist))
+   " "
+   (format "%02X " (epg-new-signature-class new-signature))
+   (epg-new-signature-fingerprint new-signature)))
+
 (defun epg-start (context args)
   "Start `epg-gpg-program' in a subprocess with given ARGS."
   (if (and (epg-context-process context)