From bfd2bd0ccc9fed8284ef932ac788d4ca0dba0336 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 14 Sep 2016 18:44:33 +0200 Subject: core: New function gpgme_op_keysign. * src/gpgme.h.in (gpgme_op_keysign_start, gpgme_op_keysign): New. (GPGME_KEYSIGN_LOCAL): New. (GPGME_KEYSIGN_LFSEP): New. (GPGME_KEYSIGN_NOEXPIRE): New. * src/context.h (ctx_op_data_id_t): Add OPDATA_KEYSIGN. * src/keysign.c: New. * src/Makefile.am (main_sources): Add keysig. * src/libgpgme.vers, src/gpgme.def: Add gpgme_op_keysign_start. * src/engine.c (_gpgme_engine_op_keysign): New. * src/engine-backend.h (engine_ops): Add 'keysign' and adjust all engine initializers. * src/engine-gpg.c (_add_arg): Add args PREFIX and ARGLEN and change callers to set them. (add_arg_pfx): New. (add_arg_len): New. (gpg_keysign): New. (_gpgme_engine_ops_gpg): Set keysign to gpg_keysign. * tests/run-keysign.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add run-keysign. Signed-off-by: Werner Koch --- src/gpgme.h.in | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/gpgme.h.in') diff --git a/src/gpgme.h.in b/src/gpgme.h.in index a26b4324..121e2ce1 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -1921,10 +1921,32 @@ gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key, gpgme_error_t gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key, int allow_secret); + +/* + * Key signing interface + */ + +/* Flags for the key signing functions. */ +#define GPGME_KEYSIGN_LOCAL (1 << 7) /* Create a local signature. */ +#define GPGME_KEYSIGN_LFSEP (1 << 8) /* Indicate LF separated user ids. */ +#define GPGME_KEYSIGN_NOEXPIRE (1 << 9) /* Force no expiration. */ + + +/* Sign the USERID of KEY using the current set of signers. */ +gpgme_error_t gpgme_op_keysign_start (gpgme_ctx_t ctx, + gpgme_key_t key, const char *userid, + unsigned long expires, + unsigned int flags); +gpgme_error_t gpgme_op_keysign (gpgme_ctx_t ctx, + gpgme_key_t key, const char *userid, + unsigned long expires, + unsigned int flags); + + /* - * Key Edit interface + * Key edit interface */ /* Edit the key KEY. Send status and command requests to FNC and -- cgit v1.2.3