Messagelib

verifydetachedbodypartmemento.h
1 /*
2  SPDX-FileCopyrightText: 2014-2021 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++/key.h>
11 #include <gpgme++/verificationresult.h>
12 
13 #include <QPointer>
14 #include <QString>
15 
16 #include "interfaces/bodypart.h"
17 
18 namespace QGpgME
19 {
20 class VerifyDetachedJob;
21 class KeyListJob;
22 }
23 
24 #include <QStringList>
25 
26 namespace MimeTreeParser
27 {
28 class VerifyDetachedBodyPartMemento : public CryptoBodyPartMemento
29 {
30  Q_OBJECT
31 public:
32  explicit VerifyDetachedBodyPartMemento(QGpgME::VerifyDetachedJob *job, QGpgME::KeyListJob *klj, const QByteArray &signature, const QByteArray &plainText);
33  ~VerifyDetachedBodyPartMemento() override;
34 
35  bool start() override;
36  void exec() override;
37 
38  const GpgME::VerificationResult &verifyResult() const
39  {
40  return m_vr;
41  }
42 
43  const GpgME::Key &signingKey() const
44  {
45  return m_key;
46  }
47 
48 private Q_SLOTS:
49  void slotResult(const GpgME::VerificationResult &vr);
50  void slotKeyListJobDone();
51  void slotNextKey(const GpgME::Key &);
52 
53 private:
54  void saveResult(const GpgME::VerificationResult &);
55  bool canStartKeyListJob() const;
56  QStringList keyListPattern() const;
57  bool startKeyListJob();
58 
59 private:
60  // input:
61  const QByteArray m_signature;
62  const QByteArray m_plainText;
64  QPointer<QGpgME::KeyListJob> m_keylistjob;
65  // output:
66  GpgME::VerificationResult m_vr;
67  GpgME::Key m_key;
68 };
69 }
70 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.