File indexing completed on 2025-03-09 04:53:54

0001 /*
0002   SPDX-FileCopyrightText: 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
0003   SPDX-FileCopyrightText: 2009 Leo Franchi <lfranchi@kde.org>
0004 
0005   SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <KMime/Headers>
0011 #include <Libkleo/Enum>
0012 #include <QByteArray>
0013 
0014 namespace KMime
0015 {
0016 class Content;
0017 }
0018 
0019 namespace ComposerTestUtil
0020 {
0021 /**
0022  * gate function to run verifySignature, verifyEncryption or verifySignatureAndEncryption.
0023  */
0024 
0025 void verify(bool sign,
0026             bool encrypt,
0027             KMime::Content *content,
0028             const QByteArray &origContent,
0029             Kleo::CryptoMessageFormat f,
0030             KMime::Headers::contentEncoding encoding);
0031 
0032 /**
0033  * Verifies that the given MIME content is signed and that the text is equal
0034  */
0035 void verifySignature(KMime::Content *content, const QByteArray &signedContent, Kleo::CryptoMessageFormat f, KMime::Headers::contentEncoding encoding);
0036 
0037 /**
0038  * Verifies that the given MIME content is encrypted, and that the text is equal
0039  */
0040 void verifyEncryption(KMime::Content *content, const QByteArray &encrContent, Kleo::CryptoMessageFormat f, bool withAttachment = false);
0041 
0042 /**
0043  * Verifies that the given MIME content is signed and then encrypted, and the original text is as specified
0044  */
0045 void verifySignatureAndEncryption(KMime::Content *content,
0046                                   const QByteArray &origContent,
0047                                   Kleo::CryptoMessageFormat f,
0048                                   bool withAttachment = false,
0049                                   bool combined = false);
0050 }