1 /*
2   SPDX-FileCopyrightText: 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
3   SPDX-FileCopyrightText: 2009 Leo Franchi <lfranchi@kde.org>
4 
5   SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #pragma once
9 
10 #include <KMime/Headers>
11 #include <Libkleo/Enum>
12 #include <QByteArray>
13 
14 namespace KMime
15 {
16 class Content;
17 }
18 
19 namespace ComposerTestUtil
20 {
21 /**
22  * gate function to run verifySignature, verifyEncryption or verifySignatureAndEncryption.
23  */
24 
25 void verify(bool sign,
26             bool encrypt,
27             KMime::Content *content,
28             const QByteArray &origContent,
29             Kleo::CryptoMessageFormat f,
30             KMime::Headers::contentEncoding encoding);
31 
32 /**
33  * Verifies that the given MIME content is signed and that the text is equal
34  */
35 void verifySignature(KMime::Content *content, const QByteArray &signedContent, Kleo::CryptoMessageFormat f, KMime::Headers::contentEncoding encoding);
36 
37 /**
38  * Verifies that the given MIME content is encrypted, and that the text is equal
39  */
40 void verifyEncryption(KMime::Content *content, const QByteArray &encrContent, Kleo::CryptoMessageFormat f, bool withAttachment = false);
41 
42 /**
43  * Verifies that the given MIME content is signed and then encrypted, and the original text is as specified
44  */
45 void verifySignatureAndEncryption(KMime::Content *content,
46                                   const QByteArray &origContent,
47                                   Kleo::CryptoMessageFormat f,
48                                   bool withAttachment = false,
49                                   bool combined = false);
50 }
51 
52