QXmpp
Version: 1.5.6
Loading...
Searching...
No Matches
src
base
QXmppHash.h
1
// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
2
//
3
// SPDX-License-Identifier: LGPL-2.1-or-later
4
5
#ifndef QXMPPHASH_H
6
#define QXMPPHASH_H
7
8
#include "QXmppGlobal.h"
9
10
#include <QByteArray>
11
12
class
QDomElement;
13
class
QXmlStreamWriter;
14
15
namespace
QXmpp
{
16
17
enum class
HashAlgorithm
: uint32_t {
18
Unknown,
19
Md2,
20
Md5,
21
Shake128,
22
Shake256,
23
Sha1,
24
Sha224,
25
Sha256,
26
Sha384,
27
Sha512,
28
Sha3_256,
29
Sha3_512,
30
Blake2b_256,
31
Blake2b_512,
32
};
33
34
}
35
36
class
QXMPP_EXPORT
QXmppHash
37
{
38
public
:
39
QXmppHash
();
40
42
bool
parse(
const
QDomElement &el);
43
void
toXml(QXmlStreamWriter *writer)
const
;
45
46
QXmpp::HashAlgorithm
algorithm()
const
;
47
void
setAlgorithm(
QXmpp::HashAlgorithm
algorithm);
48
49
QByteArray hash()
const
;
50
void
setHash(
const
QByteArray &data);
51
52
private
:
53
QXmpp::HashAlgorithm
m_algorithm = QXmpp::HashAlgorithm::Unknown;
54
QByteArray m_hash;
55
};
56
57
class
QXMPP_EXPORT
QXmppHashUsed
58
{
59
public
:
60
QXmppHashUsed
();
61
QXmppHashUsed
(
QXmpp::HashAlgorithm
algorithm);
62
64
bool
parse(
const
QDomElement &el);
65
void
toXml(QXmlStreamWriter *writer)
const
;
67
68
QXmpp::HashAlgorithm
algorithm()
const
;
69
void
setAlgorithm(
QXmpp::HashAlgorithm
algorithm);
70
71
private
:
72
QXmpp::HashAlgorithm
m_algorithm = QXmpp::HashAlgorithm::Unknown;
73
};
74
75
#endif
// QXMPPHASH_H
QXmppHashUsed
Definition
QXmppHash.h:58
QXmppHash
Definition
QXmppHash.h:37
QXmpp
QXmpp::HashAlgorithm
HashAlgorithm
Definition
QXmppHash.h:17
Generated by
1.9.8