diff options
| author | Ingo Klöcker <[email protected]> | 2022-01-13 11:51:38 +0000 |
|---|---|---|
| committer | Ingo Klöcker <[email protected]> | 2022-01-13 14:18:12 +0000 |
| commit | 4d913a8aa5dad1327bed5987dada89e9d7c5d292 (patch) | |
| tree | b7c41c831add344aaffa7dc9763da2b08f22e7ff /lang/qt/src/protocol_p.h | |
| parent | qt,tests: Add helper to hook up the test passphrase provider (diff) | |
| download | gpgme-4d913a8aa5dad1327bed5987dada89e9d7c5d292.tar.gz gpgme-4d913a8aa5dad1327bed5987dada89e9d7c5d292.zip | |
qt: Add job to add existing subkeys to other keys
* lang/qt/src/addexistingsubkeyjob.h,
lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp,
lang/qt/src/qgpgmeaddexistingsubkeyjob.h: New.
* lang/qt/src/protocol.h (class Protocol): Add pure virtual member
function addExistingSubkeyJob.
* lang/qt/src/protocol_p.h (Protocol::addExistingSubkeyJob): Implement.
* lang/qt/src/job.cpp, lang/qt/src/Makefile.am: Update accordingly.
* lang/qt/tests/Makefile.am (the_tests, moc_files, noinst_PROGRAMS):
Add new test.
(t_addexistingsubkey_SOURCES): New.
* lang/qt/tests/t-addexistingsubkey.cpp: New.
* lang/qt/tests/t-support.h (VERIFY_OR_RETURN_VALUE,
COMPARE_OR_RETURN_VALUE, VERIFY_OR_OBJECT, COMPARE_OR_OBJECT,
VERIFY_OR_FALSE, COMPARE_OR_FALSE): New.
* lang/qt/tests/t-support.h, lang/qt/tests/t-support.cpp
(class QQGpgMETest): New member function importSecretKeys.
--
The new job allows adding existing subkeys to other keys as with the
"addkey" edit-key command of gpg. The added subkey will have the same
expiration date (+/- 1 second) as the original subkey.
GnuPG-bug-id: 5770
Diffstat (limited to 'lang/qt/src/protocol_p.h')
| -rw-r--r-- | lang/qt/src/protocol_p.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lang/qt/src/protocol_p.h b/lang/qt/src/protocol_p.h index 08100a48..a9cfd824 100644 --- a/lang/qt/src/protocol_p.h +++ b/lang/qt/src/protocol_p.h @@ -57,6 +57,7 @@ #include "qgpgmechangeexpiryjob.h" #include "qgpgmechangeownertrustjob.h" #include "qgpgmechangepasswdjob.h" +#include "qgpgmeaddexistingsubkeyjob.h" #include "qgpgmeadduseridjob.h" #include "qgpgmekeyformailboxjob.h" #include "qgpgmewkdlookupjob.h" @@ -371,6 +372,19 @@ public: return new QGpgME::QGpgMEChangeOwnerTrustJob(context); } + QGpgME:: AddExistingSubkeyJob *addExistingSubkeyJob() const override + { + if (mProtocol != GpgME::OpenPGP) { + return nullptr; // only supported by gpg + } + + GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); + if (!context) { + return nullptr; + } + return new QGpgME::QGpgMEAddExistingSubkeyJob{context}; + } + QGpgME::AddUserIDJob *addUserIDJob() const Q_DECL_OVERRIDE { if (mProtocol != GpgME::OpenPGP) { |
