Messagelib

verifyopaquebodypartmemento.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 <gpgme++/decryptionresult.h>
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 VerifyOpaqueJob;
22class KeyListJob;
23}
24
25#include <QStringList>
26
27namespace MimeTreeParser
28{
29class VerifyOpaqueBodyPartMemento : public CryptoBodyPartMemento
30{
32public:
33 explicit VerifyOpaqueBodyPartMemento(QGpgME::VerifyOpaqueJob *job, QGpgME::KeyListJob *klj, const QByteArray &signature);
34 ~VerifyOpaqueBodyPartMemento() override;
35
36 bool start() override;
37 void exec() override;
38
39 const QByteArray &plainText() const
40 {
41 return m_plainText;
42 }
43
44 const GpgME::VerificationResult &verifyResult() const
45 {
46 return m_vr;
47 }
48
49 const GpgME::Key &signingKey() const
50 {
51 return m_key;
52 }
53
54private:
55 void slotResult(const GpgME::VerificationResult &vr, const QByteArray &plainText);
56 void slotKeyListJobDone();
57 void slotNextKey(const GpgME::Key &);
58
59 void saveResult(const GpgME::VerificationResult &, const QByteArray &);
60 [[nodiscard]] bool canStartKeyListJob() const;
61 [[nodiscard]] QStringList keyListPattern() const;
62 [[nodiscard]] bool startKeyListJob();
63
64 // input:
65 const QByteArray m_signature;
68 // output:
69 GpgME::VerificationResult m_vr;
70 QByteArray m_plainText;
71 GpgME::Key m_key;
72};
73}
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.