aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src')
-rw-r--r--lang/cpp/src/context.cpp17
-rw-r--r--lang/cpp/src/context.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp
index e8e57dc8..50726816 100644
--- a/lang/cpp/src/context.cpp
+++ b/lang/cpp/src/context.cpp
@@ -50,6 +50,7 @@
#include <gpgme.h>
+#include <functional>
#include <istream>
#include <numeric>
#ifndef NDEBUG
@@ -799,6 +800,22 @@ Error Context::startKeyImport(const std::vector<Key> &kk)
return err;
}
+ImportResult Context::importKeys(const std::vector<std::string> &keyIds)
+{
+ d->lastop = Private::Import;
+ const StringsToCStrings keyids{keyIds};
+ d->lasterr = gpgme_op_receive_keys(d->ctx, keyids.c_strs());
+ return ImportResult(d->ctx, Error(d->lasterr));
+}
+
+Error Context::startKeyImport(const std::vector<std::string> &keyIds)
+{
+ d->lastop = Private::Import;
+ const StringsToCStrings keyids{keyIds};
+ d->lasterr = gpgme_op_receive_keys_start(d->ctx, keyids.c_strs());
+ return Error(d->lasterr);
+}
+
ImportResult Context::importResult() const
{
if (d->lastop & Private::Import) {
diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h
index bfa6b8d8..9c2b2a5f 100644
--- a/lang/cpp/src/context.h
+++ b/lang/cpp/src/context.h
@@ -31,6 +31,7 @@
#include "verificationresult.h" // for Signature::Notation
#include <memory>
+#include <string>
#include <vector>
#include <utility>
#include <iosfwd>
@@ -225,8 +226,10 @@ public:
ImportResult importKeys(const Data &data);
ImportResult importKeys(const std::vector<Key> &keys);
+ ImportResult importKeys(const std::vector<std::string> &keyIds);
GpgME::Error startKeyImport(const Data &data);
GpgME::Error startKeyImport(const std::vector<Key> &keys);
+ GpgME::Error startKeyImport(const std::vector<std::string> &keyIds);
ImportResult importResult() const;
//