QOpcUaAuthenticationInformation Class

OPC UAの認証情報。詳細...

ヘッダ #include <QOpcUaAuthenticationInformation>
CMake: OPC UA認証情報 find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
以来:QtOpcUa 5.13

パブリック関数

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

詳細説明

このクラスは、サーバへのログインに必要な情報を保持します。サポートされる認証メカニズムは以下の通りです。

  • 匿名
  • ユーザ名
  • 証明書

anonymous メソッドはデフォルトで使用されますが、手動で設定することもできます。

これはユーザー名とパスワードを使った認証の例です。

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

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

setAnonymousAuthentication(),setUsernameAuthentication(),setCertificateAuthentication()も参照

メンバ関数のドキュメント

QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation()

デフォルトでは、パラメータを設定せずに認証情報を作成する。

QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation(const QOpcUaAuthenticationInformation &rhs)

rhs から認証情報を構築する。

const QVariant &QOpcUaAuthenticationInformation::authenticationData() const

このメソッドが返すQVariant の内容は、現在選択されている認証方法によって異なる。

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

現在の認証タイプを返します。

注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

QOpcUaUserTokenPolicy::TokenTypeも参照して ください。

[invokable] void QOpcUaAuthenticationInformation::setAnonymousAuthentication()

認証方法を anonymous に設定する。

注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] void QOpcUaAuthenticationInformation::setCertificateAuthentication()

証明書を使用する認証方法を設定する。

この認証タイプを使用する場合、QOpcUaClient に適切なQOpcUaPkiConfiguration を設定する必要があります。

注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

QOpcUaPkiConfiguration およびQOpcUaClient::setPkiConfiguration()も参照して ください。

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

与えられたusernamepassword を用いて、認証方法を username に設定します。

注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

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

この認証情報にrhs の値を設定する。

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

この認証情報がrhs と同じ値の場合、true を返す。

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