* epg-file.el (epg-file-write-region): Support public key encryption.
authorueno <ueno>
Wed, 12 Apr 2006 07:43:12 +0000 (07:43 +0000)
committerueno <ueno>
Wed, 12 Apr 2006 07:43:12 +0000 (07:43 +0000)
* epg.el (epg-passphrase-callback-function): Always display key-id.

ChangeLog
epg-file.el
epg.el

index e69de29..16b5c5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -0,0 +1,6 @@
+2006-04-12  Daiki Ueno  <ueno@unixuser.org>
+
+       * epg-file.el (epg-file-write-region): Support public key encryption.
+
+       * epg.el (epg-passphrase-callback-function): Always display key-id.
+
index dc48030..17c2dd4 100644 (file)
@@ -67,8 +67,15 @@ with GnuPG."
       (let ((coding-system-for-write 'binary)
             (coding-system-for-read 'binary)
            (context (epg-make-context))
+           recipients
+           string
            cipher)
-       (when (setq cipher (epg-encrypt-string context (buffer-string) nil))
+       (while (not (equal (setq string
+                                (read-string "To (end with an empty line): "))
+                          ""))
+         (setq recipients (cons string recipients)))
+       (when (setq cipher (epg-encrypt-string context (buffer-string)
+                                              recipients))
          (if (and (memq system-type '(ms-dos windows-nt))
                   (boundp 'buffer-file-type))
              (setq buffer-file-type t))
diff --git a/epg.el b/epg.el
index 330e7c4..6a3401d 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -461,11 +461,10 @@ This function is for internal use only."
        "Passphrase for symmetric encryption: "
      (if (eq key-id 'PIN)
         "Passphrase for PIN: "
-       (format "Passphrase for %s: "
-              (let ((entry (assoc key-id epg-user-id-alist)))
-                (if entry
-                    (cdr entry)
-                  key-id)))))))
+       (let ((entry (assoc key-id epg-user-id-alist)))
+        (if entry
+            (format "Passphrase for %s %s: " key-id (cdr entry))
+          (format "Passphrase for %s: " key-id)))))))
 
 (defun epg-progress-callback-function (what char current total handback)
   (message "%s: %d%%/%d%%" what current total))