From d804a7a4bc871f38f6cdc2cd63af3ef004580437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 5 Aug 2024 17:14:01 +0200 Subject: core: New function gpgme_op_setownertrust * src/Makefile.am (main_sources): Add new file. * src/context.h (ctx_op_data_id_t): Add OPDATA_SETOWNERTRUST. * src/engine.c, src/engine.h (_gpgme_engine_op_setownertrust): New. * src/engine-backend.h (engine_ops): Add 'setownertrust' and adjust all engine initializers. * src/engine-gpg.c (gpg_setownertrust): New. (_gpgme_engine_ops_gpg): Set setownertrust to gpg_setownertrust. * src/gpgme.h.in (gpgme_op_setownertrust_start, gpgme_op_setownertrust): New. * src/gpgme.def, src/libgpgme.vers: Add new functions. * src/setownertrust.c: New. * doc/gpgme.texi: Document new functions. * tests/Makefile.am (noinst_PROGRAMS): Add new test program. * tests/run-setownertrust.c: New. * tests/gpg/Makefile.am (c_tests): Add new file. (LDADD): Add @GPG_ERROR_LIBS@. * tests/gpg/t-setownertrust.c: New. * tests/gpg/t-support.h (have_gpg_version): New. -- This extends GPGME to support the --quick-set-ownertrust command added by GnuPG 2.4.6. This allows changing the owner trust of keys and enabling/disabling keys without using the editinteractor interface. GnuPG-bug-id: 7239 --- doc/gpgme.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'doc/gpgme.texi') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index b2bf6f8c..354ec5ab 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -4277,6 +4277,53 @@ be completed by calling @code{gpgme_wait} on the context. @end deftypefun +@c +@c gpgme_op_setownertrust +@c +@deftypefun gpgme_error_t gpgme_op_setownertrust @ + (@w{gpgme_ctx_t @var{ctx}}, @ + @w{gpgme_key_t @var{key}}, @ + @w{const char *@var{value}}); + +@since{1.24.0} + +The function @code{gpgme_op_setownertrust} sets the owner trust of the +key @var{key} or it sets the disable flag of the key @var{key}. +This function only works for OpenPGP and requires at least version 2.4.6 +of GnuPG. + +@var{key} specifies the key to operate on. + +@var{value} specifies the owner trust value to set. Valid values are +"undefined", "never", "marginal", "full", "ultimate". If @var{value} is +the string "disable" then the key @var{key} is disabled. If @var{value} +is the string "enable" then the key @var{key} is re-enabled. + +The function returns the error code @code{GPG_ERR_NO_ERROR} if the +operation was completed successfully, @code{GPG_ERR_NOT_SUPPORTED} if +the engine does not support the command, and @code{GPG_ERR_INV_VALUE} if +@var{key} is not a valid pointer or not a valid key or if @var{value} is +not a valid pointer or the empty string. + +@end deftypefun + + +@deftypefun gpgme_error_t gpgme_op_setownertrust_start @ + (@w{gpgme_ctx_t @var{ctx}}, @ + @w{gpgme_key_t @var{key}}, @ + @w{const char *@var{value}}); + +@since{1.24.0} + +The function @code{gpgme_op_setownertrust_start} initiates a +@code{gpgme_op_setownertrust} operation; see there for details. It must +be completed by calling @code{gpgme_wait} on the context. +@xref{Waiting For Completion}. + +The function returns the same error codes as @code{gpgme_op_setownertrust}. + +@end deftypefun + @node Generating Keys @subsection Generating Keys -- cgit v1.2.3