QOpcUaAuthenticationInformation Class
OPC UA の認証情報。詳細...
| ヘッダー: | #include <QOpcUaAuthenticationInformation> |
| CMake: | 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() |
(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 |
詳細な説明
このクラスは、サーバーへのログインを実行するために必要な情報を保持します。サポートされている認証メカニズムは以下の通りです。
- 匿名
- ユーザー名
- 証明書
デフォルトでは匿名方式が使用されますが、手動で設定することも可能です。
これは、ユーザー名とパスワードを使用した認証の例です。
QOpcUaAuthenticationInformation authInfo;
authInfo.setUsernameAuthentication("user", "password");
m_client->setAuthenticationInformation(authInfo);
m_client->connectToEndpoint(endpoint);setAnonymousAuthentication()、setUsernameAuthentication()、setCertificateAuthentication()も参照してください 。
メンバー関数のドキュメント
QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation()
default は、パラメータが設定されていない認証情報を生成します。
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()
認証方法を「匿名」に設定します。
注:この関数は 、メタオブジェクトシステムを介して、およびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QOpcUaAuthenticationInformation::setCertificateAuthentication()
認証方法を証明書を使用するように設定します。
この認証タイプを使用する場合は、適切に構成されたQOpcUaPkiConfiguration をQOpcUaClient に設定する必要があります。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
QOpcUaPkiConfiguration およびQOpcUaClient::setPkiConfiguration()も参照してください 。
[invokable, since 6.9] void QOpcUaAuthenticationInformation::setCertificateAuthentication(const QString &certificatePath, const QString &privateKeyPath)
認証方法を、クライアント証明書とは異なる証明書による証明書認証に設定します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
この関数は Qt 6.9 で導入されました。
[invokable] void QOpcUaAuthenticationInformation::setUsernameAuthentication(const QString &username, const QString &password)
指定されたusername およびpassword を使用して、認証方法を「username」に設定します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
QOpcUaAuthenticationInformation &QOpcUaAuthenticationInformation::operator=(const QOpcUaAuthenticationInformation &rhs)
この認証情報に、rhs の値を設定します。
bool QOpcUaAuthenticationInformation::operator==(const QOpcUaAuthenticationInformation &rhs) const
この認証情報が `rhs` と同じ値である場合、true を返します。
© 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.