From 0e19c4879193ed7fa61ad5d488f237b2b5b5d1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 3 Jan 2022 16:25:40 +0100 Subject: core: New export mode to export secret subkeys. * src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET_SUBKEY): New. * src/export.c (check_mode): Allow new mode and check for invalid combinations. (export_keys_start): Return error if new mode flag is set. * src/engine-gpg.c (export_common): Implement. * src/gpgme-tool.c (cmd_export): New option --secret-subkey. * tests/run-export.c (main): New option --secret-subkey. -- This adds support for exporting secret subkeys (via gpg's --export-secret-subkeys) to gpgme_op_export[_ext][_start]. The flag is not supported by gpgme_op_export_keys[_start] because there is no way to specify which subkey(s) to export with these functions. GnuPG-bug-id: 5757 --- doc/gpgme.texi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 8c821989..216d3cde 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -4893,7 +4893,6 @@ OpenPGP key is exported in the OpenSSH public key format. This accepts just a single key; to force the export of a specific subkey a fingerprint pattern with an appended exclamation mark may be used. - @item GPGME_EXPORT_MODE_SECRET @since{1.6.0} @@ -4901,6 +4900,16 @@ Instead of exporting the public key, the secret key is exported. This may not be combined with @code{GPGME_EXPORT_MODE_EXTERN}. For X.509 the export format is PKCS#8. +@item GPGME_EXPORT_MODE_SECRET_SUBKEY +@since{1.17.0} + +If this bit is set, then a secret subkey is exported. The subkey to +export must be specified with fingerprint pattern with an appended +exclamation mark. This is currently only allowed for OpenPGP keys. +This flag may not be combined with @code{GPGME_EXPORT_MODE_EXTERN}. +This flag is not supported by the export functions that take an array +of keys. + @item GPGME_EXPORT_MODE_RAW @since{1.6.0} -- cgit v1.2.3