Messagelib

cryptohelper.h
1/*
2 cryptohelper.h
3
4 SPDX-FileCopyrightText: 2015 Sandro Knauß <knauss@kolabsys.com>
5 SPDX-FileCopyrightText: 2001,2002 the KPGP authors
6 See file AUTHORS.kpgp for details
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11#pragma once
12
13#include <QByteArray>
14#include <QList>
15
16namespace MimeTreeParser
17{
18enum PGPBlockType {
19 UnknownBlock = -1, // BEGIN PGP ???
20 NoPgpBlock = 0,
21 PgpMessageBlock = 1, // BEGIN PGP MESSAGE
22 MultiPgpMessageBlock = 2, // BEGIN PGP MESSAGE, PART X[/Y]
23 SignatureBlock = 3, // BEGIN PGP SIGNATURE
24 ClearsignedBlock = 4, // BEGIN PGP SIGNED MESSAGE
25 PublicKeyBlock = 5, // BEGIN PGP PUBLIC KEY BLOCK
26 PrivateKeyBlock = 6, // BEGIN PGP PRIVATE KEY BLOCK (PGP 2.x: ...SECRET...)
27};
28
29class Block
30{
31public:
32 Block();
33 Block(const QByteArray &m);
34
35 Block(const QByteArray &m, PGPBlockType t);
36
37 [[nodiscard]] QByteArray text() const;
38 [[nodiscard]] PGPBlockType type() const;
39 [[nodiscard]] PGPBlockType determineType() const;
40
41 QByteArray msg;
42 PGPBlockType mType = UnknownBlock;
43};
44
45/** Parses the given message and splits it into OpenPGP blocks and
46 Non-OpenPGP blocks.
47*/
48[[nodiscard]] QList<Block> prepareMessageForDecryption(const QByteArray &msg);
49} // namespace MimeTreeParser
50
51Q_DECLARE_TYPEINFO(MimeTreeParser::Block, Q_RELOCATABLE_TYPE);
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.