(let ((args (append (list "--with-colons" "--no-greeting" "--batch"
"--with-fingerprint"
"--with-fingerprint"
- (if mode "--list-secret-keys" "--list-keys"))
+ (if (or (eq mode t) (eq mode 'secret))
+ "--list-secret-keys"
+ (if mode
+ "--list-sigs"
+ "--list-keys")))
(unless (eq (epg-context-protocol context) 'CMS)
'("--fixed-list-mode"))
(if name (list name))))
(aref line 6)))
(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 t or 'secret, only secret keyring should be searched.
+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)
(while lines