summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/mime/mailcrypto.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-26 16:43:00 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-26 16:48:21 +0200
commitae20f0a057f4740e3eedb1641d99c37601ad0b7f (patch)
treee89f8d6d0ee1e0b04ae57fecee82830f7359d406 /framework/src/domain/mime/mailcrypto.h
parente19a82c82594e3544ff5e4e82715095cf1a28c2f (diff)
downloadkube-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.h23
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
32namespace MailCrypto { 33namespace MailCrypto {
33 34
34Expected<GpgME::Error, std::unique_ptr<KMime::Content>> 35struct Key {
35processCrypto(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
39struct Error {
40 GpgME::Error key;
41};
37 42
38std::vector<GpgME::Key> findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false); 43Expected<Error, std::unique_ptr<KMime::Content>>
44processCrypto(std::unique_ptr<KMime::Content> content, const std::vector<Key> &signingKeys,
45 const std::vector<Key> &encryptionKeys, const Key &attachedKey);
39 46
40void importKeys(const std::vector<GpgME::Key> &keys); 47std::vector<Key> findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false);
48
49void importKeys(const std::vector<Key> &keys);
41 50
42struct ImportResult { 51struct ImportResult {
43 int considered; 52 int considered;
@@ -48,3 +57,7 @@ struct ImportResult {
48ImportResult importKey(const QByteArray &key); 57ImportResult importKey(const QByteArray &key);
49 58
50}; // namespace MailCrypto 59}; // namespace MailCrypto
60
61Q_DECLARE_METATYPE(MailCrypto::Key);
62
63QDebug operator<< (QDebug d, const MailCrypto::Key &);