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 +#include #include #include #ifndef NDEBUG @@ -799,6 +800,22 @@ Error Context::startKeyImport(const std::vector &kk) return err; } +ImportResult Context::importKeys(const std::vector &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 &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 +#include #include #include #include @@ -225,8 +226,10 @@ public: ImportResult importKeys(const Data &data); ImportResult importKeys(const std::vector &keys); + ImportResult importKeys(const std::vector &keyIds); GpgME::Error startKeyImport(const Data &data); GpgME::Error startKeyImport(const std::vector &keys); + GpgME::Error startKeyImport(const std::vector &keyIds); ImportResult importResult() const; //