summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorIngo Klöcker <dev@ingo-kloecker.de>2020-08-04 14:32:31 +0200
committerIngo Klöcker <dev@ingo-kloecker.de>2020-08-04 16:51:56 +0200
commitdb82e99a8a40c57a237dad030928d0fcf6b03ad7 (patch)
treedfda54ea9e78429d8e2d89238a371395b8142ad7 /doc
parent81db4122450bf7ba57ed478d89ae6e449c6e8366 (diff)
downloadgpgme-db82e99a8a40c57a237dad030928d0fcf6b03ad7.tar.gz
core: New function gpgme_op_setexpire.
* src/gpgme.h.in (gpgme_op_setexpire_start, gpgme_op_setexpire): New. * src/libgpgme.vers, src/gpgme.def: Add new functions. * src/genkey.c (setexpire): New. (gpgme_op_setexpire_start, gpgme_op_setexpire): New. * src/engine.h, src/engine.c: (_gpgme_engine_op_setexpire): New. * src/engine-backend.h (engine_ops): Add 'setexpire' and adjust all engine initializers. * src/engine-gpg.c (gpg_setexpire): New. (_gpgme_engine_ops_gpg): Set setexpire to gpg_setexpire. * doc/gpgme.texi: Document new functions. * tests/run-genkey.c: Add option --setexpire. -- This extends GPGME to support the --quick-set-expire command added by GnuPG 2.1.22. This allows changing subkeys expiry date without going through the editinteractor interface. Co-authored-by: Andre Heinecke <aheinecke@gnupg.org> GnuPG-bug-id: 4999
Diffstat (limited to 'doc')
-rw-r--r--doc/gpgme.texi75
1 files changed, 75 insertions, 0 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 6c1d0622..d3c64ee7 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -4016,6 +4016,81 @@ The function @code{gpgme_key_unref} releases a reference for the key
and all resources associated to it will be released.
@end deftypefun
+@c
+@c gpgme_op_setexpire
+@c
+@deftypefun gpgme_error_t gpgme_op_setexpire @
+ (@w{gpgme_ctx_t @var{ctx}}, @
+ @w{gpgme_key_t @var{key}}, @
+ @w{unsigned long @var{expires}}, @
+ @w{const char *@var{subfprs}}, @
+ @w{unsigned int @var{reserved}});
+
+@since{1.14.1}
+
+The function @code{gpgme_op_setexpire} sets the expiration time of
+the key @var{key} or of the specified subkeys.
+This function requires at least version 2.1.22 of GnuPG.
+
+@var{key} specifies the key to operate on.
+
+@var{expires} specifies the expiration time in seconds from now.
+To be similar to other usages where expiration times are provided
+in unsigned long this is similar to the key creation date
+and so it is in seconds from NOW.
+
+The common case is to use 0 to not set an expiration time.
+Note that this parameter takes an unsigned long value and not
+a @code{time_t} to avoid problems on systems which use a signed
+32 bit @code{time_t}. Note further that the OpenPGP protocol
+uses 32 bit values for timestamps and thus can
+only encode dates up to the year 2106.
+
+@var{subfprs} selects the subkey(s) for which the expiration time
+should be set. If @var{subfprs} is set to @code{NULL}, then the
+expiration time of the primary key is set. If @var{subfprs} is
+an asterisk (@code{*}), then the expiration times of all non-revoked
+and not yet expired subkeys are set. To select more than one subkey
+put all subkey fingerprints into one string separated by linefeeds
+characters (@code{\n}).
+
+@var{reserved} is reserved for later use and must be @code{0}.
+
+@end deftypefun
+
+
+@deftypefun gpgme_error_t gpgme_op_setexpire_start @
+ (@w{gpgme_ctx_t @var{ctx}}, @
+ @w{gpgme_key_t @var{key}}, @
+ @w{unsigned long @var{expires}}, @
+ @w{const char *@var{subfprs}}, @
+ @w{unsigned int @var{flags}});
+
+@since{1.14.1}
+
+The function @code{gpgme_op_setexpire_start} initiates a
+@code{gpgme_op_setexpire} operation; see there for details. It must
+be completed by calling @code{gpgme_wait} on the context.
+@xref{Waiting For Completion}.
+
+@end deftypefun
+
+
+@deftypefun gpgme_error_t gpgme_op_revuid_start @
+ (@w{gpgme_ctx_t @var{ctx}}, @
+ @w{gpgme_key_t @var{key}}, @
+ @w{const char *@var{userid}}, @
+ @w{unsigned int @var{flags}});
+
+@since{1.14.1}
+
+The function @code{gpgme_op_setexpire_start} initiates a
+@code{gpgme_op_setexpire} operation; see there for details. It must
+be completed by calling @code{gpgme_wait} on the context.
+@xref{Waiting For Completion}.
+
+@end deftypefun
+
@node Generating Keys
@subsection Generating Keys