Messagelib

signencryptjob.h
1 /*
2  SPDX-FileCopyrightText: 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, [email protected]
3  SPDX-FileCopyrightText: 2009 Leo Franchi <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #pragma once
9 
10 #include "abstractencryptjob.h"
11 #include "contentjobbase.h"
12 #include "messagecomposer_export.h"
13 #include "part/infopart.h"
14 
15 #include <Libkleo/Enum>
16 
17 #include <gpgme++/key.h>
18 #include <vector>
19 
20 namespace KMime
21 {
22 class Content;
23 }
24 
25 namespace MessageComposer
26 {
27 class SignEncryptJobPrivate;
28 
29 /**
30  Signs and encrypt the contents of a message.
31  Used when doing inline pgp sign+encrypt
32 */
33 class MESSAGECOMPOSER_EXPORT SignEncryptJob : public ContentJobBase, public MessageComposer::AbstractEncryptJob
34 {
35  Q_OBJECT
36 
37 public:
38  explicit SignEncryptJob(QObject *parent = nullptr);
39  ~SignEncryptJob() override;
40 
41  void setContent(KMime::Content *content);
42  void setCryptoMessageFormat(Kleo::CryptoMessageFormat format);
43  void setSigningKeys(const std::vector<GpgME::Key> &signers);
44 
45  void setEncryptionKeys(const std::vector<GpgME::Key> &keys) override;
46  void setRecipients(const QStringList &rec) override;
47 
48  void setSkeletonMessage(KMime::Message *skeletonMessage);
49 
50  void setProtectedHeaders(bool protectedHeaders);
51  void setProtectedHeadersObvoscate(bool protectedHeadersObvoscate);
52 
53  Q_REQUIRED_RESULT std::vector<GpgME::Key> encryptionKeys() const override;
54  Q_REQUIRED_RESULT QStringList recipients() const override;
55 
56  Q_REQUIRED_RESULT KMime::Content *origContent();
57 
58 protected Q_SLOTS:
59  void doStart() override;
60  void slotResult(KJob *job) override;
61  void process() override;
62 
63 private:
64  Q_DECLARE_PRIVATE(SignEncryptJob)
65 };
66 }
67 
Signs and encrypt the contents of a message.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The ContentJobBase class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.