dkimcheckfulljob.h 1.8 KB
Newer Older
1
/*
2
   SPDX-FileCopyrightText: 2019-2020 Laurent Montel <montel@kde.org>
3

4
   SPDX-License-Identifier: LGPL-2.0-or-later
5 6 7 8 9 10
*/

#ifndef DKIMCHECKFULLJOB_H
#define DKIMCHECKFULLJOB_H

#include <QObject>
Laurent Montel's avatar
Laurent Montel committed
11 12
#include "dkimauthenticationstatusinfo.h"
#include "dkimchecksignaturejob.h"
13
#include "messageviewer_private_export.h"
Laurent Montel's avatar
Laurent Montel committed
14 15
#include <MessageViewer/DKIMCheckPolicy>
#include <AkonadiCore/Item>
16 17 18 19 20 21 22 23
namespace MessageViewer {
class MESSAGEVIEWER_TESTS_EXPORT DKIMCheckFullJob : public QObject
{
    Q_OBJECT
public:
    explicit DKIMCheckFullJob(QObject *parent = nullptr);
    ~DKIMCheckFullJob();

Laurent Montel's avatar
Laurent Montel committed
24 25 26 27 28 29 30
    void startCheckFullInfo(const KMime::Message::Ptr &message);
    void startCheckFullInfo(const Akonadi::Item &item);

    Q_REQUIRED_RESULT DKIMCheckPolicy policy() const;
    void setPolicy(const DKIMCheckPolicy &policy);

Q_SIGNALS:
Laurent Montel's avatar
Laurent Montel committed
31
    void result(const MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult &checkResult, Akonadi::Item::Id id);
Laurent Montel's avatar
Laurent Montel committed
32 33 34

private:
    void slotCheckSignatureResult(const DKIMCheckSignatureJob::CheckSignatureResult &checkResult);
Laurent Montel's avatar
Laurent Montel committed
35
    void slotCheckAuthenticationStatusResult(const MessageViewer::DKIMAuthenticationStatusInfo &info);
36
    void checkSignature(const QVector<DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult> &lst = {});
Laurent Montel's avatar
Laurent Montel committed
37 38 39
    void storeKey(const QString &key, const QString &domain, const QString &selector);
    void storeInKeyManager(const QString &key, const QString &domain, const QString &selector, bool verify);
    void storeResult(const DKIMCheckSignatureJob::CheckSignatureResult &checkResult);
Laurent Montel's avatar
Laurent Montel committed
40
    void generateRule(const DKIMCheckSignatureJob::CheckSignatureResult &checkResult);
Laurent Montel's avatar
Laurent Montel committed
41
    void checkAuthenticationResults();
Laurent Montel's avatar
Laurent Montel committed
42
    DKIMCheckPolicy mCheckPolicy;
Laurent Montel's avatar
Laurent Montel committed
43 44 45
    KMime::Message::Ptr mMessage;
    Akonadi::Item mAkonadiItem;
    DKIMHeaderParser mHeaderParser;
46 47 48
};
}
#endif // DKIMCHECKFULLJOB_H