1// Copyright (C) 2018 The Qt Company Ltd.
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 QOPCUAAUTHENTICATIONINFORMATION_H
5#define QOPCUAAUTHENTICATIONINFORMATION_H
6
7#include <QtOpcUa/qopcuaglobal.h>
8#include <QtCore/qshareddata.h>
9#include <QtCore/qvariant.h>
10
11#include <QtOpcUa/QOpcUaUserTokenPolicy>
12
13QT_BEGIN_NAMESPACE
14
15class QOpcUaAuthenticationInformationData;
16class Q_OPCUA_EXPORT QOpcUaAuthenticationInformation
17{
18 Q_GADGET
19
20public:
21 QOpcUaAuthenticationInformation();
22 QOpcUaAuthenticationInformation(const QOpcUaAuthenticationInformation &);
23 QOpcUaAuthenticationInformation &operator=(const QOpcUaAuthenticationInformation &);
24 bool operator==(const QOpcUaAuthenticationInformation &rhs) const;
25 ~QOpcUaAuthenticationInformation();
26
27 Q_INVOKABLE void setAnonymousAuthentication();
28 Q_INVOKABLE void setUsernameAuthentication(const QString &username, const QString &password);
29 Q_INVOKABLE void setCertificateAuthentication();
30
31 const QVariant &authenticationData() const;
32 Q_INVOKABLE QOpcUaUserTokenPolicy::TokenType authenticationType() const;
33
34private:
35 QSharedDataPointer<QOpcUaAuthenticationInformationData> data;
36};
37
38QT_END_NAMESPACE
39
40Q_DECLARE_METATYPE(QOpcUaAuthenticationInformation)
41
42#endif // QOPCUAAUTHETICATIONINFORMATION_H
43

source code of qtopcua/src/opcua/client/qopcuaauthenticationinformation.h