:group 'epg
:type 'string)
-(defconst epg-version-number "0.0.1")
+(defconst epg-version-number "0.0.2")
(defvar epg-user-id nil
"GnuPG ID of your default identity.")
(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]+\\)"
(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))))
(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)))
(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)
(string-to-number (match-string 2 string))
(string-to-number (match-string 3 string))
(string-to-number (match-string 4 string) 16)
- (match-string 5 string)
+ (epg--time-from-seconds (match-string 5 string))
(substring string (match-end 0)))
(epg-context-result-for context 'sign)))))
(string-to-number (aref line 3))
(string-to-number (aref line 2))
(aref line 4)
- (aref line 5)
- (aref line 6)))
+ (epg--time-from-seconds (aref line 5))
+ (epg--time-from-seconds (aref line 6))))
;;;###autoload
(defun epg-list-keys (context &optional name mode)
epg-key-validity-alist)))
(string-to-number (aref (car lines) 3))
(aref (car lines) 4)
- (aref (car lines) 5)
- (aref (car lines) 6)
+ (epg--time-from-seconds (aref (car lines) 5))
+ (epg--time-from-seconds (aref (car lines) 6))
(aref (car lines) 9)
(string-to-number (aref (car lines) 10) 16)
(eq (aref (aref (car lines) 10) 2) ?x))
`epg-import-keys-from-file' or `epg-import-keys-from-string' instead."
(epg-context-set-operation context 'import-keys)
(epg-context-set-result context nil)
- (epg--start context (list "--import" (epg-data-file keys)))
+ (epg--start context (if (epg-data-file keys)
+ (list "--import" (epg-data-file keys))
+ (list "--import")))
(when (epg-data-string keys)
(if (eq (process-status (epg-context-process context)) 'run)
(process-send-string (epg-context-process context)