"Initiate a sign operation on PLAIN.
PLAIN is a data object.
-If optional 3rd argument MODE is 'clear, it makes a clear text signature.
-If MODE is t or 'detached, it makes a detached signature.
-Otherwise, it makes a normal signature.
+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 clear text signature.
If you use this function, you will need to wait for the completion of
`epg-gpg-program' by using `epg-wait-for-completion' and call
`epg-sign-file' or `epg-sign-string' instead."
(epg-context-set-result context nil)
(epg-start context
- (append (list (if (eq mode 'clear)
- "--clearsign"
- (if (or (eq mode t) (eq mode 'detached))
- "--detach-sign"
- "--sign")))
+ (append (list (if (or (eq mode t) (eq mode 'detached))
+ "--detach-sign"
+ (if (or (null mode) (eq mode 'normal))
+ "--sign"
+ "--clearsign")))
(apply #'nconc
(mapcar
(lambda (signer)
(defun epg-sign-file (context plain signature &optional mode)
"Sign a file PLAIN and store the result to a file SIGNATURE.
If SIGNATURE is nil, it returns the result as a string.
-If optional 3rd argument MODE is 'clear, it makes a clear text signature.
-If MODE is t or 'detached, it makes a detached signature.
-Otherwise, it makes a normal signature."
+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 clear text signature."
(unwind-protect
(progn
(if signature
;;;###autoload
(defun epg-sign-string (context plain &optional mode)
"Sign a string PLAIN and return the output as string.
-If optional 3rd argument MODE is 'clear, it makes a clear text signature.
-If MODE is t or 'detached, it makes a detached signature.
-Otherwise, it makes a normal signature."
+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 clear text signature."
(unwind-protect
(progn
(epg-context-set-output-file context