diff options
author | Werner Koch <[email protected]> | 2018-04-17 07:40:27 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2018-04-17 07:40:27 +0000 |
commit | 86efba2be270d2cdd0bc66c9d3fe190495b7af2f (patch) | |
tree | afeef02c607d2572d7d89013f5e8e2c740ffa717 /src/gpgme-json.c | |
parent | core: Add extended versions of the encrypt functions. (diff) | |
download | gpgme-86efba2be270d2cdd0bc66c9d3fe190495b7af2f.tar.gz gpgme-86efba2be270d2cdd0bc66c9d3fe190495b7af2f.zip |
core: New encryption flag GPGME_ENCRYPT_WANT_ADDRESS.
* src/gpgme.h.in (GPGME_ENCRYPT_WANT_ADDRESS): New flag.
* src/engine-gpg.c (add_arg_recipient): New.
(add_arg_recipient_string): New.
(append_args_from_recipients): Call new helper function.
(append_args_from_recipients_string): Ditto.
* src/gpgme-json.c (op_encrypt): Add flag "want-address".
--
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/gpgme-json.c')
-rw-r--r-- | src/gpgme-json.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpgme-json.c b/src/gpgme-json.c index 4b1cd5b8..c73bebdb 100644 --- a/src/gpgme-json.c +++ b/src/gpgme-json.c @@ -569,6 +569,7 @@ static const char hlp_encrypt[] = "no-encrypt-to: Do not use a default recipient.\n" "no-compress: Do not compress the plaintext first.\n" "throw-keyids: Request the --throw-keyids option.\n" + "want-address: Require that the keys include a mail address.\n" "wrap: Assume the input is an OpenPGP message.\n" "\n" "Response on success:\n" @@ -621,6 +622,10 @@ op_encrypt (cjson_t request, cjson_t result) goto leave; if (abool) encrypt_flags |= GPGME_ENCRYPT_WRAP; + if ((err = get_boolean_flag (request, "want-address", 0, &abool))) + goto leave; + if (abool) + encrypt_flags |= GPGME_ENCRYPT_WANT_ADDRESS; /* Get the keys. */ |