Spec-Zone.ru › Qt

Класс QOpcUaAuthenticationInformation

Информация об аутентификации OPC UA. Подробнее...

Заголовок: #include <QOpcUaAuthenticationInformation>
qmake: QT += opcua
С момента: QtOpcUa 5.13
  • Список всех членов, включая унаследованные

Открытые функции

QOpcUaAuthenticationInformation(const QOpcUaAuthenticationInformation &rhs)
QOpcUaAuthenticationInformation & operator=(const QOpcUaAuthenticationInformation &rhs)
const QVariant & authenticationData() const
QOpcUaUserTokenPolicy::TokenType authenticationType() const
void setAnonymousAuthentication()
void setCertificateAuthentication()
void setUsernameAuthentication(const QString &username, const QString &password)
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(const QOpcUaAuthenticationInformation &rhs)

Создает информацию об аутентификации из rhs.

QOpcUaAuthenticationInformation &QOpcUaAuthenticationInformation::operator=(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] void QOpcUaAuthenticationInformation::setUsernameAuthentication(const QString &username, const QString &password)

Устанавливает метод аутентификации на имя пользователя, используя указанное username и password.

Примечание: Эта функция может вызываться через систему метаобъектов и из QML. См. Q_INVOKABLE.

bool QOpcUaAuthenticationInformation::operator==(const QOpcUaAuthenticationInformation &rhs) const

Возвращает true если эта информация об аутентификации имеет то же значение, что и rhs.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qopcuaauthenticationinformation.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API