* epg.el (epg--time-from-seconds): New function.
authorueno <ueno>
Mon, 29 May 2006 02:01:32 +0000 (02:01 +0000)
committerueno <ueno>
Mon, 29 May 2006 02:01:32 +0000 (02:01 +0000)
(epg--status-ERRSIG): Convert seconds from epoch to encoded-time.
(epg--status-VALIDSIG): Ditto.
(epg--status-KEYEXPIRED): Ditto.

epa.el
epg.el

diff --git a/epa.el b/epa.el
index 7596176..2ab7557 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -401,12 +401,6 @@ If SECRET is non-nil, list secret keys instead of public keys."
            (delete-window (get-buffer-window epa-keys-buffer)))
        (kill-buffer epa-keys-buffer))))
 
-(defun epa--format-seconds (seconds)
-  (let ((number-seconds (string-to-number (concat seconds ".0"))))
-    (format-time-string "%Y-%m-%d"
-                       (cons (floor (/ number-seconds 65536))
-                             (floor (mod number-seconds 65536))))))
-
 (defun epa-show-key (key)
   (let* ((primary-sub-key (car (epg-key-sub-key-list key)))
         (entry (assoc (epg-sub-key-id primary-sub-key)
@@ -456,11 +450,13 @@ If SECRET is non-nil, list secret keys instead of public keys."
              (cdr (assq (epg-sub-key-algorithm (car pointer))
                         epg-pubkey-algorithm-alist))
              "\n\tCreated: "
-             (epa--format-seconds (epg-sub-key-creation-time (car pointer)))
+             (format-time-string "%Y-%m-%d"
+                                 (epg-sub-key-creation-time (car pointer)))
              (if (epg-sub-key-expiration-time (car pointer))
                  (format "\n\tExpires: %s"
-                         (epa--format-seconds (epg-sub-key-expiration-time
-                                               (car pointer))))
+                         (format-time-string "%Y-%m-%d"
+                                             (epg-sub-key-expiration-time
+                                              (car pointer))))
                "")
              "\n\tCapabilities: "
              (mapconcat #'symbol-name
diff --git a/epg.el b/epg.el
index b738e8f..37f2110 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -1045,6 +1045,11 @@ This function is for internal use only."
             (equal (epg-signature-key-id signature) string))
        (epg-signature-set-status signature 'no-pubkey))))
 
+(defun epg--time-from-seconds (seconds)
+  (let ((number-seconds (string-to-number (concat seconds ".0"))))
+    (cons (floor (/ number-seconds 65536))
+         (floor (mod number-seconds 65536)))))
+
 (defun epg--status-ERRSIG (context string)
   (if (string-match "\\`\\([^ ]+\\) \\([0-9]+\\) \\([0-9]+\\) \
 \\([0-9A-Fa-f][0-9A-Fa-f]\\) \\([^ ]+\\) \\([0-9]+\\)"
@@ -1065,7 +1070,7 @@ This function is for internal use only."
         (string-to-number (match-string 4 string) 16))
        (epg-signature-set-creation-time
         signature
-        (match-string 5 string)))))
+        (epg--time-from-seconds (match-string 5 string))))))
 
 (defun epg--status-VALIDSIG (context string)
   (let ((signature (car (epg-context-result-for context 'verify))))
@@ -1080,10 +1085,10 @@ This function is for internal use only."
        (match-string 1 string))
       (epg-signature-set-creation-time
        signature
-       (match-string 2 string))
+       (epg--time-from-seconds (match-string 2 string)))
       (epg-signature-set-expiration-time
        signature
-       (match-string 3 string))
+       (epg--time-from-seconds (match-string 3 string)))
       (epg-signature-set-version
        signature
        (string-to-number (match-string 4 string)))
@@ -1162,7 +1167,8 @@ This function is for internal use only."
 (defun epg--status-KEYEXPIRED (context string)
   (epg-context-set-result-for
    context 'error
-   (cons (list 'key-expired (cons 'expiration-time string))
+   (cons (list 'key-expired (cons 'expiration-time
+                                 (epg--time-from-seconds string)))
         (epg-context-result-for context 'error))))
 
 (defun epg--status-KEYREVOKED (context string)