QOpcUaApplicationIdentity Class

QOpcUaApplicationIdentity defines the identity of the application. More...

Header: #include <QOpcUaApplicationIdentity>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
Since: QtOpcUa 5.13

Public Functions

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)

Detailed Description

This info must be configured using 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();

Member Function Documentation

QOpcUaApplicationIdentity::QOpcUaApplicationIdentity()

Default constructs an application identity with no parameters set.

QOpcUaApplicationIdentity::QOpcUaApplicationIdentity(const QOpcUaApplicationIdentity &other)

Constructs an application identity from other.

QString QOpcUaApplicationIdentity::applicationName() const

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

See also setApplicationName().

QOpcUaApplicationDescription::ApplicationType QOpcUaApplicationIdentity::applicationType() const

Returns the application's type.

See also 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.

See also setApplicationUri().

bool QOpcUaApplicationIdentity::isValid() const

Returns true if the application identity contains valid data.

QString QOpcUaApplicationIdentity::productUri() const

Returns the application's productUri.

This uniquely identifies the product.

See also setProductUri().

void QOpcUaApplicationIdentity::setApplicationName(const QString &value)

Sets the application name to value.

See also applicationName().

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

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

The default value is Client.

See also applicationType().

void QOpcUaApplicationIdentity::setApplicationUri(const QString &value)

Sets the applicationUri to value.

See also applicationUri() and setApplicationName().

void QOpcUaApplicationIdentity::setProductUri(const QString &value)

Sets the productUri to value.

See also productUri().

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

Sets the values of rhs in this QOpcUaApplicationIdentity.

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