QOpcUaApplicationIdentity Class

QOpcUaApplicationIdentityはアプリケーションのIDを定義します。詳細...

ヘッダー #include <QOpcUaApplicationIdentity>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
以来:QtOpcUa 5.13

パブリック関数

QOpcUaApplicationIdentity()
QOpcUaApplicationIdentity(const QOpcUaApplicationIdentity &other)
QString applicationName() const
QOpcUaApplicationDescription::ApplicationType applicationType() const
QString applicationUri() const
bool isValid() const
QString productUri() const
void setApplicationName(const QString &value)
void setApplicationType(QOpcUaApplicationDescription::ApplicationType value)
void setApplicationUri(const QString &value)
void setProductUri(const QString &value)
QOpcUaApplicationIdentity &operator=(const QOpcUaApplicationIdentity &rhs)

詳細説明

この情報はQOpcUaClient::setApplicationIdentity を使って設定する必要があります。アプリケーション ID は、手動で設定することも、証明書から取得することもできます。

QOpcUaApplicationIdentity identity;

const QString applicationUri = QStringLiteral("urn:%1:%2:%3")
        .arg(QHostInfo::localHostName())
        .arg(QCoreApplication::organizationName())
        .arg(QCoreApplication::applicationName());
const QString productUri = QStringLiteral("urn:%1:%2")
        .arg(QCoreApplication::organizationName())
        .arg(QCoreApplication::applicationName());

identity.setProductUri(productUri);
identity.setApplicationUri(applicationUri);
identity.setApplicationName(QCoreApplication::applicationName());
identity.setApplicationType(QOpcUaApplicationDescription::Client);

client->setApplicationIdentity(identity);

アプリケーションが証明書を使用して認証する場合、アプリケーション ID は使用する証明書と一致する必要があります。この場合、すべての情報は PKI 構成で指定された証明書から抽出される。

QOpcUaApplicationIdentity identity;
identity = pkiConfig.applicationIdentity();

メンバー機能のドキュメント

QOpcUaApplicationIdentity::QOpcUaApplicationIdentity()

デフォルトでは、パラメータが設定されていないアプリケーション ID が構築されます。

QOpcUaApplicationIdentity::QOpcUaApplicationIdentity(const QOpcUaApplicationIdentity &other)

other からアプリケーションIDを構築する。

QString QOpcUaApplicationIdentity::applicationName() const

アプリケーションの可読形式の名前を返します。これは一意である必要はありません。

setApplicationName()も参照

QOpcUaApplicationDescription::ApplicationType QOpcUaApplicationIdentity::applicationType() const

アプリケーションのタイプを返します。

setApplicationType()も参照

QString QOpcUaApplicationIdentity::applicationUri() const

アプリケーションのアプリケーション URI を返します。

これは、アプリケーションのインストール・インスタンスごとに一意でなければならず、アプリケーションの証明書の ApplicationURI と一致しなければなりません。

setApplicationUri()も参照してください

bool QOpcUaApplicationIdentity::isValid() const

アプリケーション ID に有効なデータが含まれている場合に真を返します。

QString QOpcUaApplicationIdentity::productUri() const

アプリケーションの productUri を返します。

これは、製品を一意に識別します。

setProductUri()も参照してください

void QOpcUaApplicationIdentity::setApplicationName(const QString &value)

アプリケーション名をvalue に設定する。

applicationName()も参照のこと

void QOpcUaApplicationIdentity::setApplicationType(QOpcUaApplicationDescription::ApplicationType value)

アプリケーションのタイプを設定します。クライアント・アプリケーションはvalueClient に設定する必要があります。

デフォルト値はClient です。

applicationType()も参照

void QOpcUaApplicationIdentity::setApplicationUri(const QString &value)

applicationUrivalue に設定する。

applicationUri() およびsetApplicationName()も参照のこと

void QOpcUaApplicationIdentity::setProductUri(const QString &value)

productUrivalue に設定する。

productUri()も参照のこと

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

このQOpcUaApplicationIdentityrhs の値を設定する。

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