diff options
Diffstat (limited to 'lang/cpp/src/key.cpp')
-rw-r--r-- | lang/cpp/src/key.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index 66fdea96..0e86a19e 100644 --- a/lang/cpp/src/key.cpp +++ b/lang/cpp/src/key.cpp @@ -371,6 +371,27 @@ void Key::update() return; } +// static +Key Key::locate(const char *mbox) +{ + if (!mbox) { + return Key(); + } + + auto ctx = Context::createForProtocol(OpenPGP); + if (!ctx) { + return Key(); + } + + ctx->setKeyListMode (Extern | Local); + + Error e = ctx->startKeyListing (mbox); + auto ret = ctx->nextKey (e); + delete ctx; + + return ret; +} + // // // class Subkey |