summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2016-05-17 12:25:10 +0200
committerAndre Heinecke <[email protected]>2016-05-17 15:31:45 +0200
commit4ebf7b5956a1bd2d12e2a2e7e3a8f59701eae6b7 (patch)
tree5655dc8c4a616d30079472edd12c621beb1b4cc8
parent70406596957483e2fea8843efb75eb53842ef889 (diff)
Backport locateKeysJob from GpgME's QGpgME
-rw-r--r--src/backends/chiasmus/chiasmusbackend.cpp5
-rw-r--r--src/backends/qgpgme/qgpgmebackend.cpp9
-rw-r--r--src/kleo/cryptobackend.h13
3 files changed, 27 insertions, 0 deletions
diff --git a/src/backends/chiasmus/chiasmusbackend.cpp b/src/backends/chiasmus/chiasmusbackend.cpp
index 80a52b3..73133a5 100644
--- a/src/backends/chiasmus/chiasmusbackend.cpp
+++ b/src/backends/chiasmus/chiasmusbackend.cpp
@@ -644,6 +644,11 @@ public:
return 0;
}
+
+ Kleo::KeyListJob *locateKeysJob() const Q_DECL_OVERRIDE
+ {
+ return 0;
+ }
};
Kleo::ChiasmusBackend *Kleo::ChiasmusBackend::self = 0;
diff --git a/src/backends/qgpgme/qgpgmebackend.cpp b/src/backends/qgpgme/qgpgmebackend.cpp
index 1e8ef5f..a2a91c0 100644
--- a/src/backends/qgpgme/qgpgmebackend.cpp
+++ b/src/backends/qgpgme/qgpgmebackend.cpp
@@ -372,6 +372,15 @@ public:
return new Kleo::QGpgMEAddUserIDJob(context);
}
+ Kleo::KeyListJob *locateKeysJob() const Q_DECL_OVERRIDE
+ {
+ GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
+ if (!context) {
+ return Q_NULLPTR;
+ }
+ context->setKeyListMode(GpgME::Extern | GpgME::Local | GpgME::Signatures | GpgME::Validate);
+ return new Kleo::QGpgMEKeyListJob(context);
+ }
};
}
diff --git a/src/kleo/cryptobackend.h b/src/kleo/cryptobackend.h
index aa3fc40..5eef331 100644
--- a/src/kleo/cryptobackend.h
+++ b/src/kleo/cryptobackend.h
@@ -132,6 +132,19 @@ public:
virtual SignKeyJob *signKeyJob() const;
virtual AddUserIDJob *addUserIDJob() const;
virtual SpecialJob *specialJob(const char *type, const QMap<QString, QVariant> &args) const = 0;
+ /** A key locate job.
+ *
+ * This tries to find a key in local
+ * and remote sources, if the key was remote it is imported
+ * by GnuPG. Same as KeyListJob but intended to be used
+ * to locate keys automatically. This ends up calling --locate-keys.
+ *
+ * Only available for OpenPGP
+ *
+ * Results are validated. As if keyListJob was called
+ * with both includeSigs and validate options.
+ */
+ virtual KeyListJob *locateKeysJob() const = 0;
};
}