Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsslkeyingmaterial.h
Go to the documentation of this file.
1// Copyright (C) 2026 Governikus GmbH & Co. KG.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSSLKEYINGMATERIAL_H
6#define QSSLKEYINGMATERIAL_H
7
8#include <QtNetwork/qtnetworkglobal.h>
9
10#include <QtCore/qbytearray.h>
11#include <QtCore/qcompare.h>
12#include <QtCore/qtypes.h>
13
15
16
17QT_BEGIN_NAMESPACE
18
19namespace QTlsPrivate {
21}
22
23class QDebug;
24
26{
27public:
28 QSslKeyingMaterial() = default;
29 explicit QSslKeyingMaterial(const QByteArray &label, qsizetype size)
32 {
33 }
34 explicit QSslKeyingMaterial(const QByteArray &label,
35 qsizetype size,
36 const QByteArray &context)
40 {
41 }
42
43 bool isValid() const noexcept
44 {
45 return !label().isEmpty() && requestedSize() > 0;
46 }
47
48 QByteArray label() const noexcept
49 {
50 return keyingLabel;
51 }
52
53 QByteArray context() const noexcept
54 {
55 return keyingContext;
56 }
57
58 QByteArray value() const noexcept
59 {
60 return keyingValue;
61 }
62
63 qsizetype requestedSize() const noexcept
64 {
65 return keyingValueSize;
66 }
67
68 void swap(QSslKeyingMaterial &other) noexcept
69 {
70 keyingLabel.swap(other.keyingLabel);
71 keyingContext.swap(other.keyingContext);
72 keyingValue.swap(other.keyingValue);
73 std::swap(keyingValueSize, other.keyingValueSize);
74 }
75
76private:
77 QByteArray keyingLabel;
78 QByteArray keyingContext;
79 QByteArray keyingValue;
80 qsizetype keyingValueSize = 0;
81
82 friend bool comparesEqual(const QSslKeyingMaterial &lhs,
83 const QSslKeyingMaterial &rhs) noexcept
84 {
85 return lhs.keyingLabel == rhs.keyingLabel
86 && lhs.keyingContext == rhs.keyingContext
87 && lhs.keyingValue == rhs.keyingValue
88 && lhs.keyingValueSize == rhs.keyingValueSize;
89 }
91
92 friend size_t qHash(const QSslKeyingMaterial &material) noexcept
93 { return qHash(material, 0); }
95
96#ifndef QT_NO_DEBUG_STREAM
98#endif // QT_NO_DEBUG_STREAM
99
101};
102
103Q_DECLARE_SHARED(QSslKeyingMaterial)
104
105QT_END_NAMESPACE
106
107#endif // QSSLKEYINGMATERIAL_H
This class represents Online Certificate Status Protocol response.
The QSslCertificate class provides a convenient API for an X509 certificate.
The QSslCipher class represents an SSL cryptographic cipher.
Definition qsslcipher.h:23
The QSslKey class provides an interface for private and public keys.
Definition qsslkey.h:24
Describes exported keying material derived from a TLS session.
QByteArray context() const noexcept
Returns the optional context value used for deriving the keying material.
qsizetype requestedSize() const noexcept
The desired size of the keying material.
QByteArray label() const noexcept
Returns the exporter label used for deriving the keying material.
void swap(QSslKeyingMaterial &other) noexcept
\memberswap{keying material}
bool isValid() const noexcept
Returns true if this QSslKeyingMaterial object describes a valid exporter request.
QSslKeyingMaterial(const QByteArray &label, qsizetype size)
QSslKeyingMaterial()=default
Default-constructs an instance of QSslKeyingMaterial.
QSslKeyingMaterial(const QByteArray &label, qsizetype size, const QByteArray &context)
Constructs a QSslKeyingMaterial object with the given exporter label, output size,...
QByteArray value() const noexcept
Returns the exported keying material.
friend bool comparesEqual(const QSslKeyingMaterial &lhs, const QSslKeyingMaterial &rhs) noexcept
The QSslPreSharedKeyAuthenticator class provides authentication data for pre shared keys (PSK) cipher...
The QSslSocket class provides an SSL encrypted socket for both clients and servers.
Definition qsslsocket.h:30
Combined button and popup list for selecting options.
Namespace containing onternal types that TLS backends implement.
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2582
static QT_BEGIN_NAMESPACE QString msgUnsupportedMulticastAddress()
Definition qdtls.cpp:304
QT_REQUIRE_CONFIG(liburing)
QOcspRevocationReason