Messagelib

signencryptjob.h
1/*
2 SPDX-FileCopyrightText: 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
3 SPDX-FileCopyrightText: 2009 Leo Franchi <lfranchi@kde.org>
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
20namespace KMime
21{
22class Content;
23}
24
25namespace MessageComposer
26{
27class SignEncryptJobPrivate;
28
29/**
30 Signs and encrypt the contents of a message.
31 Used when doing inline pgp sign+encrypt
32*/
33class MESSAGECOMPOSER_EXPORT SignEncryptJob : public ContentJobBase, public MessageComposer::AbstractEncryptJob
34{
35 Q_OBJECT
36
37public:
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 [[nodiscard]] std::vector<GpgME::Key> encryptionKeys() const override;
54 [[nodiscard]] QStringList recipients() const override;
55
56 [[nodiscard]] KMime::Content *origContent();
57
58protected Q_SLOTS:
59 void doStart() override;
60 void slotResult(KJob *job) override;
61 void process() override;
62
63private:
64 Q_DECLARE_PRIVATE(SignEncryptJob)
65};
66}
The ContentJobBase class.
Signs and encrypt the contents of a message.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.