Messagelib

verifydetachedbodypartmemento.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 <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 
19 namespace QGpgME
20 {
21 class VerifyDetachedJob;
22 class KeyListJob;
23 }
24 
25 namespace MimeTreeParser
26 {
27 class VerifyDetachedBodyPartMemento : public CryptoBodyPartMemento
28 {
29  Q_OBJECT
30 public:
31  explicit VerifyDetachedBodyPartMemento(QGpgME::VerifyDetachedJob *job, QGpgME::KeyListJob *klj, const QByteArray &signature, const QByteArray &plainText);
32  ~VerifyDetachedBodyPartMemento() override;
33 
34  Q_REQUIRED_RESULT 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 
47 private Q_SLOTS:
48  void slotResult(const GpgME::VerificationResult &vr);
49  void slotKeyListJobDone();
50  void slotNextKey(const GpgME::Key &);
51 
52 private:
53  void saveResult(const GpgME::VerificationResult &);
54  Q_REQUIRED_RESULT bool canStartKeyListJob() const;
55  Q_REQUIRED_RESULT QStringList keyListPattern() const;
56  Q_REQUIRED_RESULT bool startKeyListJob();
57 
58 private:
59  // input:
60  const QByteArray m_signature;
61  const QByteArray m_plainText;
63  QPointer<QGpgME::KeyListJob> m_keylistjob;
64  // output:
65  GpgME::VerificationResult m_vr;
66  GpgME::Key m_key;
67 };
68 }
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 Sun Mar 26 2023 04:08:12 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.