2006-04-18 Daiki Ueno <ueno@unixuser.org>
+ * epa.el (epa-keys-mode-map): Bind epa-list-keys; epa-import-key.
+ (epa-import-key): New command.
+
* epg.el (epg-delete-problem-alist): New constant.
(epg-status-DELETE_PROBLEM): New function.
(epg-start-delete-key): New function.
(define-key keymap "s" 'epa-sign-file)
(define-key keymap "e" 'epa-encrypt-file)
(define-key keymap "r" 'epa-delete-key)
+ (define-key keymap "i" 'epa-import-key)
+ (define-key keymap "g" 'epa-list-keys)
(define-key keymap "n" 'next-line)
(define-key keymap "p" 'previous-line)
(define-key keymap " " 'scroll-up)
;;;###autoload
(defun epa-list-keys (&optional name mode)
(interactive
- (let ((name (read-string "Pattern: ")))
- (list (if (equal name "") nil name)
- current-prefix-arg)))
+ (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)
+ (y-or-n-p "Secret keys? ")))
+ (or epa-list-keys-arguments (list nil nil))))
(unless (and epa-keys-buffer
(buffer-live-p epa-keys-buffer))
(setq epa-keys-buffer (generate-new-buffer "*Keys*")))
(message "Deleting %s...done"
(epg-sub-key-id (car (epg-key-sub-key-list key))))))
+(defun epa-import-key (file)
+ (interactive "sFile: ")
+ (let ((context (epg-make-context)))
+ (message "Importing %s..." (file-name-nondirectory file))
+ (epg-import-key context file)
+ (apply #'epa-list-keys epa-list-keys-arguments)
+ (message "Importing %s...done" (file-name-nondirectory file))))
+
(provide 'epa)
;;; epa.el ends here