aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/protocol_p.h
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-05-02 13:28:09 +0000
committerIngo Klöcker <[email protected]>2022-05-02 13:51:44 +0000
commite12861f18c6b431b40bfa78eb6f1d149690a5fcd (patch)
tree045026adeffcc5105a6f9dc5b73b32556cc834c2 /lang/qt/src/protocol_p.h
parentcpp: Add RAII class for saving/restoring the key list mode (diff)
downloadgpgme-e12861f18c6b431b40bfa78eb6f1d149690a5fcd.tar.gz
gpgme-e12861f18c6b431b40bfa78eb6f1d149690a5fcd.zip
qt: Add job for refreshing OpenPGP keys
* lang/qt/src/qgpgmerefreshopenpgpkeysjob.h, lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp: New. * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Add support for OpenPGP protocol. -- The new job performs a --locate-external-keys for the email addresses of all not revoked user IDs of the given keys, and it performs a --recv-keys for the fingerprints of the given keys. The former may import new keys from WKD or an LDAP server or via some other (hopefully trusted) auto-key-locate mechanism. GnuPG-bug-id: 5951
Diffstat (limited to 'lang/qt/src/protocol_p.h')
-rw-r--r--lang/qt/src/protocol_p.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/lang/qt/src/protocol_p.h b/lang/qt/src/protocol_p.h
index 91c522f1..9ff62ee6 100644
--- a/lang/qt/src/protocol_p.h
+++ b/lang/qt/src/protocol_p.h
@@ -42,6 +42,7 @@
#include "qgpgmelistallkeysjob.h"
#include "qgpgmedecryptjob.h"
#include "qgpgmedecryptverifyjob.h"
+#include "qgpgmerefreshopenpgpkeysjob.h"
#include "qgpgmerefreshsmimekeysjob.h"
#include "qgpgmedeletejob.h"
#include "qgpgmedownloadjob.h"
@@ -283,12 +284,15 @@ public:
QGpgME::RefreshKeysJob *refreshKeysJob() const Q_DECL_OVERRIDE
{
- if (mProtocol != GpgME::CMS) { // fixme: add support for gpg, too
- return nullptr;
+ if (mProtocol == GpgME::CMS) {
+ return new QGpgME::QGpgMERefreshSMIMEKeysJob;
}
- // this operation is not supported by gpgme, so we have to call gpgsm ourselves:
- return new QGpgME::QGpgMERefreshSMIMEKeysJob();
+ GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
+ if (!context) {
+ return nullptr;
+ }
+ return new QGpgME::QGpgMERefreshOpenPGPKeysJob{context};
}
QGpgME::DownloadJob *downloadJob(bool armor) const Q_DECL_OVERRIDE