* epg.el (epg-make-key-signature): New object epg-key-signature.
(epg-list-keys): Collect key signatures.
(epg-make-sub-key): Renamed secret -> secret-p.
+ (epg-list-keys-postprocess-one-key): Abolished.
+ (epg-list-keys): Reverse all keys, sub-keys, user-ids, and key
+ signatures by itself.
2006-05-01 Daiki Ueno <ueno@unixuser.org>
(aref line 5)
(aref line 6)))
-(defun epg-list-keys-postprocess-one-key (key)
- (let (key-id user-id-string entry)
- (epg-key-set-sub-key-list
- key
- (nreverse (epg-key-sub-key-list key)))
- (epg-key-set-user-id-list
- key
- (nreverse (epg-key-user-id-list key)))
- (setq key-id
- (epg-sub-key-id (car (epg-key-sub-key-list key)))
- user-id-string
- (epg-user-id-string (car (epg-key-user-id-list key)))
- entry (assoc key-id epg-user-id-alist))
- (if entry
- (setcdr entry user-id-string)
- (setq epg-user-id-alist (cons (cons key-id user-id-string)
- epg-user-id-alist)))))
-
;;;###autoload
(defun epg-list-keys (context &optional name mode)
"Return a list of epg-key objects matched with NAME.
Otherwise, only public keyring should be searched and the key
signatures should be included."
(let ((lines (epg-list-keys-1 context name mode))
- keys cert)
+ keys cert pointer pointer-1)
(while lines
(cond
((member (aref (car lines) 0) '("pub" "sec" "crt" "crs"))
- (if (car keys)
- (epg-list-keys-postprocess-one-key (car keys)))
(setq cert (member (aref (car lines) 0) '("crt" "crs"))
keys (cons (epg-make-key
(if (aref (car lines) 8)
(epg-user-id-signature-list
(car (epg-key-user-id-list (car keys))))))))
(setq lines (cdr lines)))
- (if (car keys)
- (epg-list-keys-postprocess-one-key (car keys)))
- (nreverse keys)))
+ (setq keys (nreverse keys)
+ pointer keys)
+ (while pointer
+ (epg-key-set-sub-key-list
+ (car pointer)
+ (nreverse (epg-key-sub-key-list (car pointer))))
+ (setq pointer-1 (epg-key-set-user-id-list
+ (car pointer)
+ (nreverse (epg-key-user-id-list (car pointer)))))
+ (while pointer-1
+ (epg-user-id-set-signature-list
+ (car pointer-1)
+ (nreverse (epg-user-id-signature-list (car pointer-1))))
+ (setq pointer-1 (cdr pointer-1)))
+ (setq pointer (cdr pointer)))
+ keys))
(if (fboundp 'make-temp-file)
(defalias 'epg-make-temp-file 'make-temp-file)