이 페이지에서

QOpcUaAuthenticationInformation Class

OPC UA 인증 정보. 더 보기...

헤더: #include <QOpcUaAuthenticationInformation>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
다음부터: QtOpcUa 5.13부터

공개 함수

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

Default는 매개변수가 설정되지 않은 인증 정보를 생성합니다.

QOpcUaAuthenticationInformation::QOpcUaAuthenticationInformation(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, since 6.9] void QOpcUaAuthenticationInformation::setCertificateAuthentication(const QString &certificatePath, const QString &privateKeyPath)

인증 방식을 클라이언트 인증서와 다른 인증서를 사용하는 인증서 인증으로 설정합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.

이 함수는 Qt 6.9에서 도입되었습니다.

[invokable] void QOpcUaAuthenticationInformation::setUsernameAuthentication(const QString &username, const QString &password)

지정된 username 및 password 을 사용하여 인증 방법을 ‘username’으로 설정합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.

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

이 인증 정보에 rhs 의 값을 설정합니다.

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

이 인증 정보의 값이 rhs 과 동일한 경우, true 를 반환합니다.

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