diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-26 16:43:00 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-26 16:48:21 +0200 |
commit | ae20f0a057f4740e3eedb1641d99c37601ad0b7f (patch) | |
tree | e89f8d6d0ee1e0b04ae57fecee82830f7359d406 /framework/src/domain/mime/mailcrypto.h | |
parent | e19a82c82594e3544ff5e4e82715095cf1a28c2f (diff) | |
download | kube-ae20f0a057f4740e3eedb1641d99c37601ad0b7f.tar.gz kube-ae20f0a057f4740e3eedb1641d99c37601ad0b7f.zip |
No more direct GpgMe usage in the interfaces.
Diffstat (limited to 'framework/src/domain/mime/mailcrypto.h')
-rw-r--r-- | framework/src/domain/mime/mailcrypto.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/framework/src/domain/mime/mailcrypto.h b/framework/src/domain/mime/mailcrypto.h index 9e317b43..c9247859 100644 --- a/framework/src/domain/mime/mailcrypto.h +++ b/framework/src/domain/mime/mailcrypto.h | |||
@@ -25,19 +25,28 @@ | |||
25 | #include <gpgme++/key.h> | 25 | #include <gpgme++/key.h> |
26 | 26 | ||
27 | #include <QByteArray> | 27 | #include <QByteArray> |
28 | #include <QVariant> | ||
28 | 29 | ||
29 | #include <functional> | 30 | #include <functional> |
30 | #include <memory> | 31 | #include <memory> |
31 | 32 | ||
32 | namespace MailCrypto { | 33 | namespace MailCrypto { |
33 | 34 | ||
34 | Expected<GpgME::Error, std::unique_ptr<KMime::Content>> | 35 | struct Key { |
35 | processCrypto(std::unique_ptr<KMime::Content> content, const std::vector<GpgME::Key> &signingKeys, | 36 | GpgME::Key key; |
36 | const std::vector<GpgME::Key> &encryptionKeys, const GpgME::Key &attachedKey); | 37 | }; |
38 | |||
39 | struct Error { | ||
40 | GpgME::Error key; | ||
41 | }; | ||
37 | 42 | ||
38 | std::vector<GpgME::Key> findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false); | 43 | Expected<Error, std::unique_ptr<KMime::Content>> |
44 | processCrypto(std::unique_ptr<KMime::Content> content, const std::vector<Key> &signingKeys, | ||
45 | const std::vector<Key> &encryptionKeys, const Key &attachedKey); | ||
39 | 46 | ||
40 | void importKeys(const std::vector<GpgME::Key> &keys); | 47 | std::vector<Key> findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false); |
48 | |||
49 | void importKeys(const std::vector<Key> &keys); | ||
41 | 50 | ||
42 | struct ImportResult { | 51 | struct ImportResult { |
43 | int considered; | 52 | int considered; |
@@ -48,3 +57,7 @@ struct ImportResult { | |||
48 | ImportResult importKey(const QByteArray &key); | 57 | ImportResult importKey(const QByteArray &key); |
49 | 58 | ||
50 | }; // namespace MailCrypto | 59 | }; // namespace MailCrypto |
60 | |||
61 | Q_DECLARE_METATYPE(MailCrypto::Key); | ||
62 | |||
63 | QDebug operator<< (QDebug d, const MailCrypto::Key &); | ||