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();
Default constructs an application identity with no parameters set.
构造应用程序身份从 other .
Returns the human readable name of the application. This does not need to be unique.
另请参阅 setApplicationName ().
返回应用程序的类型。
另请参阅 setApplicationType ().
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 ().
Returns true if the application identity contains valid data.
返回应用程序的 productUri。
这唯一标识产品。
另请参阅 setProductUri ().
将应用程序名称设为 value .
另请参阅 applicationName ().
Sets the type of the application. Client applications should set value to Client .
默认值为 Client .
另请参阅 applicationType ().
设置 applicationUri to value .
另请参阅 applicationUri () 和 setApplicationName ().
设置 productUri to value .
另请参阅 productUri ().
Sets the values of rhs 在此 QOpcUaApplicationIdentity .