2006-04-17 Daiki Ueno <ueno@unixuser.org>
+ * epa.el (epa-verify-file): Display verify result.
+
* epg.el (epg-invalid-recipients-alist): New variable.
(epg-status-INV_RECP): New function.
(epg-status-NO_RECP): New function.
(let ((file-list (dired-get-marked-files)))
(while file-list
(epa-decrypt-file (car file-list))
- (setq file-list (cdr file-list)))))
+ (setq file-list (cdr file-list)))
+ (revert-buffer)))
(defun epa-dired-do-verify ()
"Verify marked files."
(let ((file-list (dired-get-marked-files)))
(while file-list
(epa-verify-file (car file-list))
- (setq file-list (cdr file-list)))))
+ (setq file-list (cdr file-list)))
+ (revert-buffer)))
(defun epa-dired-do-sign (&optional detached)
"Sign marked files."
(let ((file-list (dired-get-marked-files)))
(while file-list
(epa-sign-file (expand-file-name (car file-list)) detached)
- (setq file-list (cdr file-list)))))
+ (setq file-list (cdr file-list)))
+ (revert-buffer)))
(defun epa-dired-do-encrypt ()
"Encrypt marked files."
(car (epg-key-sub-key-list key))))
(epa-select-keys "Select recipents for encryption.
If no one is selected, symmetric encryption will be performed. ")))
- (setq file-list (cdr file-list)))))
+ (setq file-list (cdr file-list)))
+ (revert-buffer)))
(provide 'epa-dired)
(goto-char (point-min))
(let (keys key)
(while (re-search-forward "^\\*" nil t)
- (if (setq key (get-text-property (match-beginning 0) 'epa-key))
+ (if (setq key (get-text-property (match-beginning 0)
+ 'epa-key))
(setq keys (cons key keys))))
(nreverse keys))))
(if (get-buffer-window epa-keys-buffer)
(interactive "fFile: ")
(let* ((context (epg-make-context))
(plain (if (equal (file-name-extension file) "sig")
- (file-name-sans-extension file))))
+ (file-name-sans-extension file)))
+ signature)
(message "Verifying %s..." (file-name-nondirectory file))
(epg-verify-file context file plain)
+ (setq signature (reverse (epg-context-result-for context 'verify)))
+ (with-output-to-temp-buffer "*epa-verify-file*"
+ (set-buffer standard-output)
+ (while signature
+ (insert (format "%s: %s %s %s\n"
+ (epg-signature-status (car signature))
+ (epg-signature-key-id (car signature))
+ (epg-signature-user-id (car signature))
+ (epg-signature-validity (car signature))))
+ (setq signature (cdr signature))))
+ (shrink-window-if-larger-than-buffer
+ (get-buffer-window "*epa-verify-file*"))
(message "Verifying %s...done" (file-name-nondirectory file))))
(defun epa-sign-file (file detached)