(setq alist (cdr alist)))
(nreverse result)))
+(defalias 'epg-make-temp-file 'make-temp-file)
+
;;;###autoload
(defun epg-decrypt-start (context input-file)
"Initiate a decrypt operation on INPUT-FILE.
(epg-wait-for-status context '("BEGIN_DECRYPTION")))
;;;###autoload
+(defun epg-decrypt-file (context input-file)
+ "Decrypt INPUT-FILE and return the plain text."
+ (unwind-protect
+ (progn
+ (epg-decrypt-start context input-file)
+ (epg-wait-for-completion context)
+ (unless (epg-context-result-for context 'decrypt)
+ (epg-read-output context)))
+ (epg-reset context)
+ (if (file-exists-p input-file)
+ (delete-file input-file))))
+
+;;;###autoload
(defun epg-decrypt-string (context string)
"Decrypt STRING and return the plain text."
(let ((input-file (epg-make-temp-file "epg-input"))
(unwind-protect
(progn
(write-region string nil input-file)
- (epg-decrypt-start context input-file)
- (epg-wait-for-completion context)
- (unless (epg-context-result-for context 'decrypt)
- (epg-read-output context)))
- (epg-reset context)
+ (epg-decrypt-file context input-file))
(if (file-exists-p input-file)
(delete-file input-file)))))
(list "-r" recipient))
recipients))))
(if sign
- (epg-wait-for-status context '("BEGIN_SIGNING")))
+ (epg-wait-for-status context '("BEGIN_SIGNING"))
+ (if (null recipients)
+ (epg-wait-for-status context '("BEGIN_ENCRYPTION"))))
(if (eq (process-status (epg-context-process context)) 'run)
(process-send-string (epg-context-process context) string)))