* epa-file.el (epa-file-write-region): RECIPIENTS is now a list of
authorueno <ueno>
Thu, 20 Apr 2006 03:29:01 +0000 (03:29 +0000)
committerueno <ueno>
Thu, 20 Apr 2006 03:29:01 +0000 (03:29 +0000)
key objects.
* epa-dired.el (epa-dired-do-encrypt): RECIPIENTS is now a list of
key objects.

* epa.el (epa-select-keys): Added MODE argument.
(epa-encrypt-file): RECIPIENTS is now a list of key objects.

* epg.el (epg-status-SIG_CREATED): New function.
(epg-start-sign): epg-context-signers is now a list of key objects.
(epg-start-encrypt): RECIPIENTS is now a list of key objects.

ChangeLog
epa-dired.el
epa-file.el
epa.el
epg.el

index da5c4af..eb4fb26 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-04-20  Daiki Ueno  <ueno@unixuser.org>
+
+       * epa-file.el (epa-file-write-region): RECIPIENTS is now a list of
+       key objects.
+       * epa-dired.el (epa-dired-do-encrypt): RECIPIENTS is now a list of
+       key objects.
+
+       * epa.el (epa-select-keys): Added MODE argument.
+       (epa-encrypt-file): RECIPIENTS is now a list of key objects.
+
+       * epg.el (epg-status-SIG_CREATED): New function.
+       (epg-start-sign): epg-context-signers is now a list of key objects.
+       (epg-start-encrypt): RECIPIENTS is now a list of key objects.
+
 2006-04-19  Daiki Ueno  <ueno@unixuser.org>
 
        * epa.el (epa-verify-file): Show results in minibuffer.
index 993fb29..06d382c 100644 (file)
     (while file-list
       (epa-encrypt-file
        (expand-file-name (car file-list))
-       (mapcar (lambda (key)
-                (epg-sub-key-id
-                 (car (epg-key-sub-key-list key))))
-              (epa-select-keys "Select recipents for encryption.
-If no one is selected, symmetric encryption will be performed.  ")))
+       (epa-select-keys "Select recipents for encryption.
+If no one is selected, symmetric encryption will be performed.  "))
       (setq file-list (cdr file-list)))
     (revert-buffer)))
 
index 6ba67f2..d4c9fb2 100644 (file)
                   (encode-coding-string start coding-system)
                 (encode-coding-string (buffer-substring start end)
                                       coding-system))
-              (mapcar (lambda (key)
-                        (epg-sub-key-id (car (epg-key-sub-key-list key))))
-                      (unless (assoc file epa-file-passphrase-alist)
+              (unless (assoc file epa-file-passphrase-alist)
                         (epa-select-keys
                    "Select recipents for encryption.
-If no one is selected, symmetric encryption will be performed.  ")))))
+If no one is selected, symmetric encryption will be performed.  "))))
       (error
        (if (setq entry (assoc file epa-file-passphrase-alist))
           (setcdr entry nil))
diff --git a/epa.el b/epa.el
index 0c90a7c..87ed7b5 100644 (file)
--- a/epa.el
+++ b/epa.el
        (beginning-of-line)
        (get-text-property (point) 'epa-key))))
 
-(defun epa-select-keys (prompt &optional names)
+(defun epa-select-keys (prompt &optional names mode)
   (save-excursion
     (unless (and epa-keys-buffer
                 (buffer-live-p epa-keys-buffer))
       (if names
          (while names
            (setq point (point))
-           (epa-list-keys-1 (car names) nil)
+           (epa-list-keys-1 (car names) mode)
            (goto-char point)
            (epa-mark)
            (goto-char (point-max))
            (setq names (cdr names)))
-       (epa-list-keys-1 nil nil))
+       (epa-list-keys-1 nil mode))
       (epa-keys-mode)
       (goto-char (point-min))
       (pop-to-buffer (current-buffer))
 (defun epa-encrypt-file (file recipients)
   (interactive
    (list (expand-file-name (read-file-name "File: "))
-        (mapcar (lambda (key)
-                  (epg-sub-key-id
-                   (car (epg-key-sub-key-list key))))
-                (epa-select-keys "Select recipents for encryption.
-If no one is selected, symmetric encryption will be performed.  "))))
+        (epa-select-keys "Select recipents for encryption.
+If no one is selected, symmetric encryption will be performed.  ")))
   (let ((cipher (concat file ".gpg"))
        (context (epg-make-context)))
     (message "Encrypting %s..." (file-name-nondirectory file))
diff --git a/epg.el b/epg.el
index beebfc1..d1d9160 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -727,6 +727,21 @@ This function is for internal use only."
        (cons (cons 'delete-problem (string-to-number (match-string 1 string)))
             (epg-context-result-for epg-context 'error)))))
 
+(defun epg-status-SIG_CREATED (process string)
+  (if (string-match "\\`\\([DCS]\\) \\([0-9]+\\) \\([0-9]+\\) \
+\\([0-9A-Fa-F][0-9A-Fa-F]\\) \\(.*\\) " string)
+      (epg-context-set-result-for
+       epg-context 'sign
+       (cons (list (cons 'type (string-to-char (match-string 1 string)))
+                  (cons 'pubkey-algorithm
+                        (string-to-number (match-string 2 string)))
+                  (cons 'digest-algorithm
+                        (string-to-number (match-string 3 string)))
+                  (cons 'class (string-to-number (match-string 4 string) 16))
+                  (cons 'creation-time (match-string 5 string))
+                  (cons 'fingerprint (substring string (match-end 0))))
+            (epg-context-result-for epg-context 'sign)))))
+
 (defun epg-passphrase-callback-function (key-id handback)
   (read-passwd
    (if (eq key-id 'SYM)
@@ -1056,9 +1071,12 @@ If you are unsure, use synchronous version of this function
                                 "--detach-sign"
                               "--sign")))
                     (apply #'nconc
-                           (mapcar (lambda (signer)
-                                     (list "-u" signer))
-                                   (epg-context-signers context)))
+                           (mapcar
+                            (lambda (signer)
+                              (list "-u"
+                                    (epg-sub-key-id
+                                     (car (epg-key-sub-key-list signer)))))
+                            (epg-context-signers context)))
                     (if (epg-data-file plain)
                         (list (epg-data-file plain)))))
   (epg-wait-for-status context '("BEGIN_SIGNING"))
@@ -1134,9 +1152,12 @@ If you are unsure, use synchronous version of this function
                                                (list "-u" signer))
                                              (epg-context-signers context)))))
                     (apply #'nconc
-                           (mapcar (lambda (recipient)
-                                     (list "-r" recipient))
-                                   recipients))
+                           (mapcar
+                            (lambda (recipient)
+                              (list "-r"
+                                    (epg-sub-key-id
+                                     (car (epg-key-sub-key-list recipient)))))
+                            recipients))
                     (if (epg-data-file plain)
                         (list (epg-data-file plain)))))
   (if sign