* epg-file.el (epg-file-write-region): Support public key encryption.
[elisp/epg.git] / epg-file.el
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))