aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/context.h
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2020-08-04 14:22:37 +0000
committerIngo Klöcker <[email protected]>2020-08-04 14:53:29 +0000
commitaa03205fe5e8a8fa2b0feecb8a142aff2a1b25df (patch)
tree7796f204a9d1f22925fd05431cab41519bc2893c /lang/cpp/src/context.h
parentcpp: Add ostream operator for subkey (diff)
downloadgpgme-aa03205fe5e8a8fa2b0feecb8a142aff2a1b25df.tar.gz
gpgme-aa03205fe5e8a8fa2b0feecb8a142aff2a1b25df.zip
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
Diffstat (limited to 'lang/cpp/src/context.h')
-rw-r--r--lang/cpp/src/context.h16
1 files changed, 15 insertions, 1 deletions
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 <memory>
@@ -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<Subkey> &subkeys = std::vector<Subkey>(),
+ const SetExpireFlags flags = SetExpireDefault);
+ Error startSetExpire(const Key &k, unsigned long expires,
+ const std::vector<Subkey> &subkeys = std::vector<Subkey>(),
+ 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<Key> &recipients);
+ std::string getLFSeparatedListOfFingerprintsFromSubkeys(const std::vector<Subkey> &subkeys);
+
private:
Private *const d;