Messagelib

verifydetachedbodypartmemento.h
1/*
2 SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "cryptobodypartmemento.h"
10#include <QStringList>
11#include <gpgme++/key.h>
12#include <gpgme++/verificationresult.h>
13
14#include <QPointer>
15#include <QString>
16
17#include "interfaces/bodypart.h"
18
19namespace QGpgME
20{
21class VerifyDetachedJob;
22class KeyListJob;
23}
24
25namespace MimeTreeParser
26{
27class VerifyDetachedBodyPartMemento : public CryptoBodyPartMemento
28{
30public:
31 explicit VerifyDetachedBodyPartMemento(QGpgME::VerifyDetachedJob *job, QGpgME::KeyListJob *klj, const QByteArray &signature, const QByteArray &plainText);
32 ~VerifyDetachedBodyPartMemento() override;
33
34 [[nodiscard]] bool start() override;
35 void exec() override;
36
37 const GpgME::VerificationResult &verifyResult() const
38 {
39 return m_vr;
40 }
41
42 const GpgME::Key &signingKey() const
43 {
44 return m_key;
45 }
46
47private:
48 void slotResult(const GpgME::VerificationResult &vr);
49 void slotKeyListJobDone();
50 void slotNextKey(const GpgME::Key &);
51
52 void saveResult(const GpgME::VerificationResult &);
53 [[nodiscard]] bool canStartKeyListJob() const;
54 [[nodiscard]] QStringList keyListPattern() const;
55 [[nodiscard]] bool startKeyListJob();
56
57private:
58 // input:
59 const QByteArray m_signature;
60 const QByteArray m_plainText;
63 // output:
64 GpgME::VerificationResult m_vr;
65 GpgME::Key m_key;
66};
67}
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.