From 86efba2be270d2cdd0bc66c9d3fe190495b7af2f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 17 Apr 2018 09:40:27 +0200 Subject: 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 --- src/gpgme-json.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gpgme-json.c') 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. */ -- cgit v1.2.3