Auf dieser Seite

QOpcUaAuthenticationInformation Class

Die OPC-UA-Authentifizierungsdaten. Mehr...

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

Öffentliche Funktionen

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

Ausführliche Beschreibung

Diese Klasse enthält die Informationen, die für die Anmeldung bei einem Server erforderlich sind. Unterstützte Authentifizierungsmechanismen sind

  • Anonym
  • Benutzername
  • Zertifikat

Standardmäßig wird die anonyme Methode verwendet, sie kann jedoch auch manuell festgelegt werden.

Dies ist ein Beispiel für eine Authentifizierung mit Benutzername und Passwort.

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

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

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

Dokumentation zu den Member-Funktionen

QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation()

„default“ erstellt Authentifizierungsdaten, ohne dass Parameter festgelegt werden.

QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation(const QOpcUaAuthenticationInformation &rhs)

Erstellt Authentifizierungsdaten aus „ rhs “.

const QVariant &QOpcUaAuthenticationInformation::authenticationData() const

Der Inhalt des von dieser Methode zurückgegebenen „ QVariant “ hängt von der aktuell ausgewählten Authentifizierungsmethode ab.

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

Gibt den aktuellen Authentifizierungstyp zurück.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

Siehe auch QOpcUaUserTokenPolicy::TokenType.

[invokable] void QOpcUaAuthenticationInformation::setAnonymousAuthentication()

Legt die Authentifizierungsmethode auf „anonym“ fest.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

[invokable] void QOpcUaAuthenticationInformation::setCertificateAuthentication()

Legt die Authentifizierungsmethode auf die Verwendung von Zertifikaten fest.

Bei Verwendung dieser Authentifizierungsart muss eine ordnungsgemäß konfigurierte ` QOpcUaPkiConfiguration ` unter ` QOpcUaClient` festgelegt werden.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe „ Q_INVOKABLE “.

Siehe auch „ QOpcUaPkiConfiguration “ und „ QOpcUaClient::setPkiConfiguration()“.

[invokable, since 6.9] void QOpcUaAuthenticationInformation::setCertificateAuthentication(const QString &certificatePath, const QString &privateKeyPath)

Legt die Authentifizierungsmethode auf die Zertifikatsauthentifizierung fest, wobei ein anderes Zertifikat als das Client-Zertifikat verwendet wird.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

Diese Funktion wurde in Qt 6.9 eingeführt.

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

Legt die Authentifizierungsmethode auf „username“ fest und verwendet dabei die angegebenen Werte „ username “ und „ password “.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

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

Legt die Werte aus „ rhs “ in diesen Authentifizierungsinformationen fest.

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

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

© 2026 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.