The OPC UA authentication information. 更多...
头: | #include <QOpcUaAuthenticationInformation> |
qmake: | QT += opcua |
Since: | QtOpcUa 5.13 |
This class was introduced in QtOpcUa 5.13.
QOpcUaAuthenticationInformation (const QOpcUaAuthenticationInformation & rhs ) | |
QOpcUaAuthenticationInformation & | operator= (const QOpcUaAuthenticationInformation & rhs ) |
const QVariant & | authenticationData () const |
QOpcUaUserTokenPolicy::TokenType | authenticationType () const |
void | setAnonymousAuthentication () |
void | setCertificateAuthentication () |
void | setUsernameAuthentication (const QString & username , const QString & password ) |
bool | operator== (const QOpcUaAuthenticationInformation & rhs ) const |
This class holds the information necessary to perform a login on a server. Supported authentication mechanisms are
The anonymous method is used by default but also can be set manually.
This is an example authentication using username and password.
QOpcUaAuthenticationInformation authInfo; authInfo.setUsernameAuthentication("user", "password"); m_client->setAuthenticationInformation(authInfo); m_client->connectToEndpoint(endpoint);
另请参阅 setAnonymousAuthentication (), setUsernameAuthentication (),和 setCertificateAuthentication ().
Constructs an authentication information from rhs .
设置值从 rhs in this authentication information.
The content of the QVariant returned by this method depends on the currently selected authentication method.
Returns the current authentication type.
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
另请参阅 QOpcUaUserTokenPolicy::TokenType .
Sets the authentication method to anonymous.
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
Sets the authentication method to use certificates.
When using this authentication type a proper configured QOpcUaPkiConfiguration has to be set to the QOpcUaClient .
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
另请参阅 QOpcUaPkiConfiguration and QOpcUaClient::setPkiConfiguration ().
Sets the authentication method to username, using the given username and password .
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
返回
true
if this authentication information has the same value as
rhs
.