From aa03205fe5e8a8fa2b0feecb8a142aff2a1b25df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Tue, 4 Aug 2020 16:22:37 +0200 Subject: cpp: Add support for gpgme_op_setexpire * lang/cpp/src/context.cpp (Context::setExpire, Context::startSetExpire): New. (Context::getLFSeparatedListOfFingerprintsFromSubkeys): New helper. * lang/cpp/src/context.h (Context::SetExpireFlags): New enum. (Context::setExpire, Context::startSetExpire): Add prototypes. (Context::getLFSeparatedListOfFingerprintsFromSubkeys): Add as private helper. -- GnuPG-bug-id: 5003 --- lang/cpp/src/context.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lang/cpp/src/context.h') diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h index 70f1c429..ebf5adb2 100644 --- a/lang/cpp/src/context.h +++ b/lang/cpp/src/context.h @@ -27,6 +27,7 @@ #include "global.h" #include "error.h" +#include "key.h" #include "verificationresult.h" // for Signature::Notation #include @@ -37,7 +38,6 @@ namespace GpgME { -class Key; class Data; class TrustItem; class ProgressProvider; @@ -273,6 +273,18 @@ public: unsigned long expires = 0, unsigned int flags = 0); + enum SetExpireFlags { + SetExpireDefault = 0, + SetExpireAllSubkeys = 1 + }; + + Error setExpire(const Key &k, unsigned long expires, + const std::vector &subkeys = std::vector(), + const SetExpireFlags flags = SetExpireDefault); + Error startSetExpire(const Key &k, unsigned long expires, + const std::vector &subkeys = std::vector(), + const SetExpireFlags flags = SetExpireDefault); + // using TofuInfo::Policy Error setTofuPolicy(const Key &k, unsigned int policy); Error setTofuPolicyStart(const Key &k, unsigned int policy); @@ -488,6 +500,8 @@ private: // on the "Friendlyness" of context to access the gpgme types. gpgme_key_t *getKeysFromRecipients(const std::vector &recipients); + std::string getLFSeparatedListOfFingerprintsFromSubkeys(const std::vector &subkeys); + private: Private *const d; -- cgit v1.2.3