Changeset View
Changeset View
Standalone View
Standalone View
framework/src/domain/mime/mailcrypto.h
Show All 13 Lines | 1 | /* | |||
---|---|---|---|---|---|
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to the | 15 | along with this library; see the file COPYING.LIB. If not, write to the | ||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301, USA. | 17 | 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #pragma once | 20 | #pragma once | ||
21 | 21 | | |||
22 | #include <QByteArray> | 22 | #include "framework/src/errors.h" | ||
23 | | ||||
23 | #include <KMime/Message> | 24 | #include <KMime/Message> | ||
24 | #include <gpgme++/key.h> | 25 | #include <gpgme++/key.h> | ||
26 | | ||||
27 | #include <QByteArray> | ||||
28 | | ||||
25 | #include <functional> | 29 | #include <functional> | ||
30 | #include <memory> | ||||
31 | | ||||
32 | namespace MailCrypto { | ||||
33 | | ||||
34 | Expected<GpgME::Error, std::unique_ptr<KMime::Content>> | ||||
35 | processCrypto(std::unique_ptr<KMime::Content> content, const std::vector<GpgME::Key> &signingKeys, | ||||
36 | const std::vector<GpgME::Key> &encryptionKeys, const GpgME::Key &attachedKey); | ||||
37 | | ||||
38 | std::vector<GpgME::Key> findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false); | ||||
26 | 39 | | |||
27 | namespace MailCrypto | | |||
28 | { | | |||
29 | enum Protocol { | | |||
30 | OPENPGP, | | |||
31 | SMIME | | |||
32 | }; | | |||
33 | KMime::Content *processCrypto(KMime::Content *content, const std::vector<GpgME::Key> &signingKeys, const std::vector<GpgME::Key> &encryptionKeys, MailCrypto::Protocol protocol); | | |||
34 | KMime::Content *sign(KMime::Content *content, const std::vector<GpgME::Key> &signers); | | |||
35 | std::vector<GpgME::Key> findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false, Protocol protocol = OPENPGP); | | |||
36 | void importKeys(const std::vector<GpgME::Key> &keys); | 40 | void importKeys(const std::vector<GpgME::Key> &keys); | ||
37 | }; | 41 | | ||
42 | }; // namespace MailCrypto |