QOpcUaApplicationIdentity 类

QOpcUaApplicationIdentity 定义应用程序的身份。 更多...

头: #include <QOpcUaApplicationIdentity>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
Since: 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 . The application identity can be set up manually or derived from a certificate.

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);
					

In case your application authenticates using certificates the application identity has to match the used certificate. In this case all information is extracted from the certificate given in the PKI configuration.

QOpcUaApplicationIdentity identity;
identity = pkiConfig.applicationIdentity();
					

成员函数文档编制

QOpcUaApplicationIdentity:: QOpcUaApplicationIdentity ()

Default constructs an application identity with no parameters set.

QOpcUaApplicationIdentity:: QOpcUaApplicationIdentity (const QOpcUaApplicationIdentity & other )

构造应用程序身份从 other .

QString QOpcUaApplicationIdentity:: applicationName () const

Returns the human readable name of the application. This does not need to be unique.

另请参阅 setApplicationName ().

QOpcUaApplicationDescription::ApplicationType QOpcUaApplicationIdentity:: applicationType () const

返回应用程序的类型。

另请参阅 setApplicationType ().

QString QOpcUaApplicationIdentity:: applicationUri () const

Returns the application's application URI.

This must be unique for each installation instance of the application and must match the ApplicationURI in the application's certificate.

另请参阅 setApplicationUri ().

bool QOpcUaApplicationIdentity:: isValid () const

Returns true if the application identity contains valid data.

QString QOpcUaApplicationIdentity:: productUri () const

返回应用程序的 productUri。

这唯一标识产品。

另请参阅 setProductUri ().

void QOpcUaApplicationIdentity:: setApplicationName (const QString & value )

将应用程序名称设为 value .

另请参阅 applicationName ().

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

Sets the type of the application. Client applications should set value to Client .

默认值为 Client .

另请参阅 applicationType ().

void QOpcUaApplicationIdentity:: setApplicationUri (const QString & value )

设置 applicationUri to value .

另请参阅 applicationUri () 和 setApplicationName ().

void QOpcUaApplicationIdentity:: setProductUri (const QString & value )

设置 productUri to value .

另请参阅 productUri ().

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

Sets the values of rhs 在此 QOpcUaApplicationIdentity .