summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/mime/mailcrypto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/mime/mailcrypto.cpp')
-rw-r--r--framework/src/domain/mime/mailcrypto.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/framework/src/domain/mime/mailcrypto.cpp b/framework/src/domain/mime/mailcrypto.cpp
index 6c5d1b4f..8cf55089 100644
--- a/framework/src/domain/mime/mailcrypto.cpp
+++ b/framework/src/domain/mime/mailcrypto.cpp
@@ -25,10 +25,12 @@
25#include <QGpgME/EncryptJob> 25#include <QGpgME/EncryptJob>
26#include <QGpgME/SignEncryptJob> 26#include <QGpgME/SignEncryptJob>
27#include <QGpgME/KeyListJob> 27#include <QGpgME/KeyListJob>
28#include <QGpgME/ImportFromKeyserverJob>
28#include <gpgme++/global.h> 29#include <gpgme++/global.h>
29#include <gpgme++/signingresult.h> 30#include <gpgme++/signingresult.h>
30#include <gpgme++/encryptionresult.h> 31#include <gpgme++/encryptionresult.h>
31#include <gpgme++/keylistresult.h> 32#include <gpgme++/keylistresult.h>
33#include <gpgme++/importresult.h>
32#include <QDebug> 34#include <QDebug>
33 35
34/* 36/*
@@ -460,11 +462,20 @@ KMime::Content *MailCrypto::sign(KMime::Content *content, const std::vector<GpgM
460 return processCrypto(content, signers, {}, OPENPGP); 462 return processCrypto(content, signers, {}, OPENPGP);
461} 463}
462 464
463std::vector<GpgME::Key> MailCrypto::findKeys(const QStringList &filter, bool findPrivate, Protocol protocol) 465
466void MailCrypto::importKeys(const std::vector<GpgME::Key> &keys)
467{
468 const QGpgME::Protocol *const backend = QGpgME::openpgp();
469 Q_ASSERT(backend);
470 auto *job = backend->importFromKeyserverJob();
471 job->exec(keys);
472}
473
474std::vector<GpgME::Key> MailCrypto::findKeys(const QStringList &filter, bool findPrivate, bool remote, Protocol protocol)
464{ 475{
465 const QGpgME::Protocol *const backend = protocol == SMIME ? QGpgME::smime() : QGpgME::openpgp(); 476 const QGpgME::Protocol *const backend = protocol == SMIME ? QGpgME::smime() : QGpgME::openpgp();
466 Q_ASSERT(backend); 477 Q_ASSERT(backend);
467 QGpgME::KeyListJob *job = backend->keyListJob(false); 478 QGpgME::KeyListJob *job = backend->keyListJob(remote);
468 Q_ASSERT(job); 479 Q_ASSERT(job);
469 480
470 std::vector<GpgME::Key> keys; 481 std::vector<GpgME::Key> keys;