From 5efd3486a9fa9f4b0f383aca2f2f01412e73237c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Tue, 19 Dec 2023 11:26:15 +0100 Subject: core: Support writing the decrypt/verify output directly to a file * src/engine-gpg.c (gpg_decrypt): Pass output file name to gpg if output has file name set. (gpg_verify): Ditto. * tests/run-decrypt.c (show_usage): New option --output. (main): Parse new option. Set file name on output if --output is given. Do not print output if --output is given. * tests/run-verify.c (show_usage): New option --output. (main): Parse new option. Set file name on output if --output is given. -- This change makes it possible to tell gpg to write the output (i.e. the decrypted/verified data) directly to a file with given file name instead of piping the output back to gpgme. GnuPG-bug-id: 6550 --- doc/gpgme.texi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index e7a568a3..32bca164 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -5630,7 +5630,9 @@ An error code describing the reason why the key was found invalid. The function @code{gpgme_op_decrypt} decrypts the ciphertext in the data object @var{cipher} or, if a file name is set on the data object, the ciphertext stored in the corresponding file. The decrypted -ciphertext is stored into the data object @var{plain}. +ciphertext is stored into the data object @var{plain} or written to +the file set with @code{gpgme_data_set_file_name} for the data object +@var{plain}. The function returns the error code @code{GPG_ERR_NO_ERROR} if the ciphertext could be decrypted successfully, @code{GPG_ERR_INV_VALUE} @@ -5846,7 +5848,9 @@ writable data object that will contain the plaintext after successful verification. If a file name is set on the data object @var{sig} (or on the data object @var{signed_text}), then the data of the signature (resp. the data of the signed text) is not read from the data object -but from the file with the given file name. +but from the file with the given file name. If a file name is set on +the data object @var{plain} then the plaintext is not stored in the +data object but it is written to a file with the given file name. The results of the individual signature verifications can be retrieved with @code{gpgme_op_verify_result}. -- cgit v1.2.3