+(defun epa--list-keys (name secret)
+ (unless (and epa-keys-buffer
+ (buffer-live-p epa-keys-buffer))
+ (setq epa-keys-buffer (generate-new-buffer "*Keys*")))
+ (set-buffer epa-keys-buffer)
+ (epa-key-list-mode)
+ (let ((inhibit-read-only t)
+ buffer-read-only
+ (point (point-min))
+ (context (epg-make-context epa-protocol)))
+ (unless (get-text-property point 'epa-list-keys)
+ (setq point (next-single-property-change point 'epa-list-keys)))
+ (when point
+ (delete-region point
+ (or (next-single-property-change point 'epa-list-keys)
+ (point-max)))
+ (goto-char point))
+ (epa--insert-keys context name secret)
+ (widget-setup)
+ (set-keymap-parent (current-local-map) widget-keymap))
+ (make-local-variable 'epa-list-keys-arguments)
+ (setq epa-list-keys-arguments (list name secret))
+ (goto-char (point-min))
+ (pop-to-buffer (current-buffer)))
+
+;;;###autoload
+(defun epa-list-keys (&optional name)
+ "List all keys matched with NAME from the public keyring."
+ (interactive
+ (if current-prefix-arg
+ (let ((name (read-string "Pattern: "
+ (if epa-list-keys-arguments
+ (car epa-list-keys-arguments)))))
+ (list (if (equal name "") nil name)))
+ (list nil)))
+ (epa--list-keys name nil))
+
+;;;###autoload
+(defun epa-list-secret-keys (&optional name)
+ "List all keys matched with NAME from the private keyring."
+ (interactive
+ (if current-prefix-arg
+ (let ((name (read-string "Pattern: "
+ (if epa-list-keys-arguments
+ (car epa-list-keys-arguments)))))
+ (list (if (equal name "") nil name)))
+ (list nil)))
+ (epa--list-keys name t))
+
+(defun epa--key-list-revert-buffer (&optional ignore-auto noconfirm)
+ (apply #'epa--list-keys epa-list-keys-arguments))
+
+(defun epa--marked-keys ()