Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qsslpresharedkeyauthenticator.h
Go to the documentation of this file.
1// Copyright (C) 2014 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
4#ifndef QSSLPRESHAREDKEYAUTHENTICATOR_H
5#define QSSLPRESHAREDKEYAUTHENTICATOR_H
6
7#include <QtNetwork/qtnetworkglobal.h>
8#include <QtCore/QString>
9#include <QtCore/QSharedDataPointer>
10#include <QtCore/QMetaType>
11
13
15
18{
19public:
20 Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator();
21 Q_NETWORK_EXPORT ~QSslPreSharedKeyAuthenticator();
22 Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator(const QSslPreSharedKeyAuthenticator &authenticator);
23 Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator);
24
26
28
29 Q_NETWORK_EXPORT QByteArray identityHint() const;
30
31 Q_NETWORK_EXPORT void setIdentity(const QByteArray &identity);
32 Q_NETWORK_EXPORT QByteArray identity() const;
33 Q_NETWORK_EXPORT int maximumIdentityLength() const;
34
35 Q_NETWORK_EXPORT void setPreSharedKey(const QByteArray &preSharedKey);
36 Q_NETWORK_EXPORT QByteArray preSharedKey() const;
37 Q_NETWORK_EXPORT int maximumPreSharedKeyLength() const;
38
39private:
40 Q_NETWORK_EXPORT bool isEqual(const QSslPreSharedKeyAuthenticator &other) const;
41
42 friend class QTlsBackend;
43
45 { return lhs.isEqual(rhs); }
47 { return !lhs.isEqual(rhs); }
48
50};
51
52
53Q_DECLARE_SHARED(QSslPreSharedKeyAuthenticator)
54
56
58QT_DECL_METATYPE_EXTERN_TAGGED(QSslPreSharedKeyAuthenticator*, QSslPreSharedKeyAuthenticator_ptr, Q_NETWORK_EXPORT)
59
60#endif // QSSLPRESHAREDKEYAUTHENTICATOR_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qshareddata.h:35
void swap(QSharedDataPointer &other) noexcept
Swap this instance's shared data pointer with the shared data pointer in other.
Definition qshareddata.h:96
The QSslPreSharedKeyAuthenticator class provides authentication data for pre shared keys (PSK) cipher...
friend bool operator!=(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs)
void swap(QSslPreSharedKeyAuthenticator &other) noexcept
Swaps the QSslPreSharedKeyAuthenticator object authenticator with this object.
QSslPreSharedKeyAuthenticator & operator=(QSslPreSharedKeyAuthenticator &&other) noexcept
Move-assigns the QSslPreSharedKeyAuthenticator object authenticator to this object,...
Q_NETWORK_EXPORT void setIdentity(const QByteArray &identity)
Sets the PSK client identity (to be advised to the server) to identity.
Q_NETWORK_EXPORT QByteArray identityHint() const
Returns the PSK identity hint as provided by the server.
Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator()
Constructs a default QSslPreSharedKeyAuthenticator object.
Q_NETWORK_EXPORT QByteArray preSharedKey() const
Returns the pre shared key.
Q_NETWORK_EXPORT int maximumIdentityLength() const
Returns the maximum length, in bytes, of the PSK client identity.
Q_NETWORK_EXPORT ~QSslPreSharedKeyAuthenticator()
Destroys the QSslPreSharedKeyAuthenticator object.
Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator & operator=(const QSslPreSharedKeyAuthenticator &authenticator)
Assigns the QSslPreSharedKeyAuthenticator object authenticator to this object, and returns a referenc...
Q_NETWORK_EXPORT QByteArray identity() const
Returns the PSK client identity.
Q_NETWORK_EXPORT void setPreSharedKey(const QByteArray &preSharedKey)
Sets the pre shared key to preSharedKey.
Q_NETWORK_EXPORT int maximumPreSharedKeyLength() const
Returns the maximum length, in bytes, of the pre shared key.
friend bool operator==(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs)
QTlsBackend is a factory class, providing implementations for the QSsl classes.
Combined button and popup list for selecting options.
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1367
#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT)
Definition qmetatype.h:1355
#define QT_REQUIRE_CONFIG(feature)
QSharedPointer< T > other(t)
[5]