* epg.el (epg-signature-to-string): Print creation-time and used
pubkey-algorithm.
+ (epg-sign-string): If the GnuPG version is earlier than 1.4.3,
+ fallback to use a temp file as an input.
2006-12-31 Daiki Ueno <ueno@unixuser.org>
If optional 3rd argument MODE is t or 'detached, it makes a detached signature.
If it is nil or 'normal, it makes a normal signature.
Otherwise, it makes a cleartext signature."
+ (let ((input-file (if (or (eq (epg-context-protocol context) 'CMS)
+ (condition-case nil
+ (progn
+ (epg-check-configuration (epg-configuration))
+ t)
+ (error)))
+ (epg--make-temp-file "epg-input")))
+ (coding-system-for-write 'binary))
(unwind-protect
(progn
(epg-context-set-output-file context
(epg--make-temp-file "epg-output"))
- (epg-start-sign context (epg-make-data-from-string plain) mode)
+ (if input-file
+ (write-region plain nil input-file nil 'quiet))
+ (epg-start-sign context
+ (if input-file
+ (epg-make-data-from-file input-file)
+ (epg-make-data-from-string plain))
+ mode)
(epg-wait-for-completion context)
(unless (epg-context-result-for context 'sign)
(if (epg-context-result-for context 'error)
(error "Sign failed")))
(epg-read-output context))
(epg-delete-output-file context)
- (epg-reset context)))
+ (if input-file
+ (delete-file input-file))
+ (epg-reset context))))
;;;###autoload
(defun epg-start-encrypt (context plain recipients