Messagelib

verifyopaquebodypartmemento.h
1 /*
2  SPDX-FileCopyrightText: 2014-2023 Laurent Montel <[email protected]>
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 
19 namespace QGpgME
20 {
21 class VerifyOpaqueJob;
22 class KeyListJob;
23 }
24 
25 #include <QStringList>
26 
27 namespace MimeTreeParser
28 {
29 class VerifyOpaqueBodyPartMemento : public CryptoBodyPartMemento
30 {
31  Q_OBJECT
32 public:
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 
54 private Q_SLOTS:
55  void slotResult(const GpgME::VerificationResult &vr, const QByteArray &plainText);
56  void slotKeyListJobDone();
57  void slotNextKey(const GpgME::Key &);
58 
59 private:
60  void saveResult(const GpgME::VerificationResult &, const QByteArray &);
61  Q_REQUIRED_RESULT bool canStartKeyListJob() const;
62  Q_REQUIRED_RESULT QStringList keyListPattern() const;
63  Q_REQUIRED_RESULT bool startKeyListJob();
64 
65 private:
66  // input:
67  const QByteArray m_signature;
69  QPointer<QGpgME::KeyListJob> m_keylistjob;
70  // output:
71  GpgME::VerificationResult m_vr;
72  QByteArray m_plainText;
73  GpgME::Key m_key;
74 };
75 }
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Mar 24 2023 04:08:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.