(signal 'wrong-type-argument (list 'epg-user-id-p user-id)))
(aset (cdr user-id) 2 signature-list))
+(defun epg-make-key-signature (validity pubkey-algorithm key-id creation-time
+ expiration-time user-id class
+ exportable-p)
+ "Return a key signature object."
+ (cons 'epg-key-signature
+ (vector validity pubkey-algorithm key-id creation-time expiration-time
+ user-id class exportable-p)))
+
+(defun epg-key-signature-validity (key-signature)
+ "Return the validity of KEY-SIGNATURE."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 0))
+
+(defun epg-key-signature-pubkey-algorithm (key-signature)
+ "Return the public key algorithm of KEY-SIGNATURE."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 1))
+
+(defun epg-key-signature-key-id (key-signature)
+ "Return the key-id of KEY-SIGNATURE."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 2))
+
+(defun epg-key-signature-creation-time (key-signature)
+ "Return the creation time of KEY-SIGNATURE."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 3))
+
+(defun epg-key-signature-expiration-time (key-signature)
+ "Return the expiration time of KEY-SIGNATURE."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 4))
+
+(defun epg-key-signature-user-id (key-signature)
+ "Return the user-id of KEY-SIGNATURE."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 5))
+
+(defun epg-key-signature-class (key-signature)
+ "Return the class of KEY-SIGNATURE."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 6))
+
+(defun epg-key-signature-exportable-p (key-signature)
+ "Return t if KEY-SIGNATURE is exportable."
+ (unless (eq (car key-signature) 'epg-key-signature)
+ (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
+ (aref (cdr key-signature) 7))
+
(defun epg-context-result-for (context name)
"Return the result of CONTEXT associated with NAME."
(cdr (assq name (epg-context-result context))))
"--with-fingerprint"
(if (memq mode '(t secret))
"--list-secret-keys"
- (if mode
- "--list-sigs"
- "--list-keys")))
+ (if (memq mode '(nil public))
+ "--list-keys"
+ "--list-sigs")))
(unless (eq (epg-context-protocol context) 'CMS)
'("--fixed-list-mode"))
(if name (list name))))
(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.
-If MODE is nil, only public keyring should be searched.
+If MODE is nil or 'public, only public keyring should be searched.
If MODE is t or 'secret, only secret keyring should be searched.
Otherwise, only public keyring should be searched and the key
signatures should be included."
(epg-key-user-id-list (car keys)))))
((equal (aref (car lines) 0) "fpr")
(epg-sub-key-set-fingerprint (car (epg-key-sub-key-list (car keys)))
- (aref (car lines) 9))))
+ (aref (car lines) 9)))
+ ((equal (aref (car lines) 0) "sig")
+ (epg-user-id-set-signature-list
+ (car (epg-key-user-id-list (car keys)))
+ (cons
+ (epg-make-key-signature
+ (if (aref (car lines) 1)
+ (cdr (assq (string-to-char (aref (car lines) 1))
+ epg-key-validity-alist)))
+ (string-to-number (aref (car lines) 3))
+ (aref (car lines) 4)
+ (aref (car lines) 5)
+ (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-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)))