| 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 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | class QOpcUaAuthenticationInformationData; |
| 16 | class Q_OPCUA_EXPORT QOpcUaAuthenticationInformation |
| 17 | { |
| 18 | Q_GADGET |
| 19 | |
| 20 | public: |
| 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 | Q_INVOKABLE void setCertificateAuthentication(const QString &certificatePath, const QString &privateKeyPath); |
| 31 | |
| 32 | const QVariant &authenticationData() const; |
| 33 | Q_INVOKABLE QOpcUaUserTokenPolicy::TokenType authenticationType() const; |
| 34 | |
| 35 | private: |
| 36 | QSharedDataPointer<QOpcUaAuthenticationInformationData> data; |
| 37 | }; |
| 38 | |
| 39 | QT_END_NAMESPACE |
| 40 | |
| 41 | Q_DECLARE_METATYPE(QOpcUaAuthenticationInformation) |
| 42 | |
| 43 | #endif // QOPCUAAUTHETICATIONINFORMATION_H |
| 44 |
