aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/verificationresult.h
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2016-10-10 15:38:43 +0000
committerAndre Heinecke <[email protected]>2016-10-10 15:38:43 +0000
commitb6b820bff14a9aa8fa67755b246c90062ffdba14 (patch)
tree6eaf3d66600389c3383b6daf682205166fbbce69 /lang/cpp/src/verificationresult.h
parentcpp: Return null key if the signature had no key (diff)
downloadgpgme-b6b820bff14a9aa8fa67755b246c90062ffdba14.tar.gz
gpgme-b6b820bff14a9aa8fa67755b246c90062ffdba14.zip
Add convenience function to get key from sig
* lang/cpp/src/verificationresult.cpp (Signature::key(bool, bool)): New. Can be used to search / update the key associcated with this signature. -- By using update a caller can ensure that an incomplete key obtainable through the new key() function is fully loaded. With search the key can be looked up in the internal keyring. As the results are cached this can be done in the crypto thread and the result then better used in the UI thread.
Diffstat (limited to '')
-rw-r--r--lang/cpp/src/verificationresult.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/cpp/src/verificationresult.h b/lang/cpp/src/verificationresult.h
index 93288af2..b6d1d8ce 100644
--- a/lang/cpp/src/verificationresult.h
+++ b/lang/cpp/src/verificationresult.h
@@ -163,6 +163,27 @@ public:
* set or the associated TOFU Information if applicable. */
GpgME::Key key() const;
+ /* Search / Update the key of this signature.
+ *
+ * Same as above but if search is set to true this will
+ * either update the key provided by the engine or search
+ * the key in the engine. The key is cached.
+ *
+ * As this involves an engine call it might take some time
+ * to finish so it should be avoided to do this in a UI
+ * thread. The result will be cached and no engine call
+ * will be done if update is set to false and a key is
+ * already cached.
+ *
+ * If no key was provided by the engine this will look
+ * up the key so this call might block while the engine
+ * is called to obtain the key.
+ *
+ * If both search and update are false this is the same
+ * as calling key()
+ */
+ GpgME::Key key(bool search, bool update) const;
+
private:
std::shared_ptr<VerificationResult::Private> d;
unsigned int idx;