QOpcUaAuthenticationInformation Class

Die OPC UA Authentifizierungsinformationen. Mehr...

Kopfzeile: #include <QOpcUaAuthenticationInformation>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
Since: QtOpcUa 5.13

Öffentliche Funktionen

QOpcUaAuthenticationInformation()
QOpcUaAuthenticationInformation(const QOpcUaAuthenticationInformation &rhs)
const QVariant &authenticationData() const
QOpcUaUserTokenPolicy::TokenType authenticationType() const
void setAnonymousAuthentication()
void setCertificateAuthentication()
void setUsernameAuthentication(const QString &username, const QString &password)
QOpcUaAuthenticationInformation &operator=(const QOpcUaAuthenticationInformation &rhs)
bool operator==(const QOpcUaAuthenticationInformation &rhs) const

Detaillierte Beschreibung

Diese Klasse enthält die Informationen, die notwendig sind, um eine Anmeldung an einem Server durchzuführen. Unterstützte Authentifizierungsmechanismen sind

  • Anonym
  • Benutzername
  • Zertifikat

Die anonyme Methode wird standardmäßig verwendet, kann aber auch manuell eingestellt werden.

Dies ist ein Beispiel für die Authentifizierung mit Benutzernamen und Passwort.

QOpcUaAuthenticationInformation authInfo;
authInfo.setUsernameAuthentication("user", "password");

m_client->setAuthenticationInformation(authInfo);
m_client->connectToEndpoint(endpoint);

Siehe auch setAnonymousAuthentication(), setUsernameAuthentication(), und setCertificateAuthentication().

Dokumentation der Mitgliedsfunktionen

QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation()

Standard konstruiert eine Authentifizierungsinformation ohne gesetzte Parameter.

QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation(const QOpcUaAuthenticationInformation &rhs)

Konstruiert eine Authentifizierungsinformation aus rhs.

const QVariant &QOpcUaAuthenticationInformation::authenticationData() const

Der Inhalt der von dieser Methode zurückgegebenen QVariant hängt von der aktuell gewählten Authentifizierungsmethode ab.

[invokable] QOpcUaUserTokenPolicy::TokenType QOpcUaAuthenticationInformation::authenticationType() const

Gibt den aktuellen Authentifizierungstyp zurück.

Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.

Siehe auch QOpcUaUserTokenPolicy::TokenType.

[invokable] void QOpcUaAuthenticationInformation::setAnonymousAuthentication()

Setzt die Authentifizierungsmethode auf anonymous.

Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.

[invokable] void QOpcUaAuthenticationInformation::setCertificateAuthentication()

Legt die Authentifizierungsmethode zur Verwendung von Zertifikaten fest.

Bei der Verwendung dieses Authentifizierungstyps muss eine ordnungsgemäß konfigurierte QOpcUaPkiConfiguration auf die QOpcUaClient gesetzt werden.

Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.

Siehe auch QOpcUaPkiConfiguration und QOpcUaClient::setPkiConfiguration().

[invokable] void QOpcUaAuthenticationInformation::setUsernameAuthentication(const QString &username, const QString &password)

Setzt die Authentifizierungsmethode auf username, unter Verwendung der angegebenen username und password.

Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.

QOpcUaAuthenticationInformation &QOpcUaAuthenticationInformation::operator=(const QOpcUaAuthenticationInformation &rhs)

Legt die Werte von rhs in dieser Authentifizierungsinformation fest.

bool QOpcUaAuthenticationInformation::operator==(const QOpcUaAuthenticationInformation &rhs) const

Gibt true zurück, wenn diese Authentifizierungsinformationen denselben Wert wie rhs haben.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.