open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
opcua::ClientConfig Class Reference

#include <client.hpp>

Inheritance diagram for opcua::ClientConfig:
[legend]

Detailed Description

Client configuration.

See also
UA_ClientConfig

Definition at line 35 of file client.hpp.

Public Member Functions

 ClientConfig ()
 
 ClientConfig (const ByteString &certificate, const ByteString &privateKey, Span< const ByteString > trustList, Span< const ByteString > revocationList={})
 
 ClientConfig (UA_ClientConfig &&native)
 
 ~ClientConfig ()
 
 ClientConfig (const ClientConfig &)=delete
 
 ClientConfig (ClientConfig &&other) noexcept
 
ClientConfigoperator= (const ClientConfig &)=delete
 
ClientConfigoperator= (ClientConfig &&other) noexcept
 
void setLogger (LogFunction func)
 
void setTimeout (uint32_t milliseconds) noexcept
 
void setUserIdentityToken (const AnonymousIdentityToken &token)
 
void setUserIdentityToken (const UserNameIdentityToken &token)
 
void setUserIdentityToken (const X509IdentityToken &token)
 
void setUserIdentityToken (const IssuedIdentityToken &token)
 
void setSecurityMode (MessageSecurityMode mode) noexcept
 
- Public Member Functions inherited from opcua::Wrapper< UA_ClientConfig >
constexpr Wrapper ()=default
 
constexpr Wrapper (const UA_ClientConfig &native)
 
constexpr Wrapper (UA_ClientConfig &&native) noexcept
 
constexpr operator UA_ClientConfig & () noexcept
 
constexpr operator const UA_ClientConfig & () const noexcept
 
constexpr UA_ClientConfigoperator-> () noexcept
 
constexpr const UA_ClientConfigoperator-> () const noexcept
 
constexpr UA_ClientConfighandle () noexcept
 
constexpr const UA_ClientConfighandle () const noexcept
 

Additional Inherited Members

- Public Types inherited from opcua::Wrapper< UA_ClientConfig >
using NativeType
 
- Protected Member Functions inherited from opcua::Wrapper< UA_ClientConfig >
constexpr const UA_ClientConfignative () const noexcept
 
constexpr UA_ClientConfignative () noexcept
 

Constructor & Destructor Documentation

◆ ClientConfig() [1/5]

opcua::ClientConfig::ClientConfig ( )

Create client config with default configuration (no encryption).

Security policies:

◆ ClientConfig() [2/5]

opcua::ClientConfig::ClientConfig ( const ByteString & certificate,
const ByteString & privateKey,
Span< const ByteString > trustList,
Span< const ByteString > revocationList = {} )

Create client config with encryption enabled (PKI).

Security policies:

Parameters
certificateX.509 v3 certificate in DER encoded format
privateKeyPrivate key in PEM encoded format
trustListList of trusted certificates in DER encoded format
revocationListCertificate revocation lists (CRL) in DER encoded format
See also
https://reference.opcfoundation.org/Core/Part2/v105/docs/8
https://reference.opcfoundation.org/Core/Part6/v105/docs/6.2

◆ ClientConfig() [3/5]

opcua::ClientConfig::ClientConfig ( UA_ClientConfig && native)
explicit

◆ ~ClientConfig()

opcua::ClientConfig::~ClientConfig ( )

◆ ClientConfig() [4/5]

opcua::ClientConfig::ClientConfig ( const ClientConfig & )
delete

◆ ClientConfig() [5/5]

opcua::ClientConfig::ClientConfig ( ClientConfig && other)
noexcept

Member Function Documentation

◆ operator=() [1/2]

ClientConfig & opcua::ClientConfig::operator= ( const ClientConfig & )
delete

◆ operator=() [2/2]

ClientConfig & opcua::ClientConfig::operator= ( ClientConfig && other)
noexcept

◆ setLogger()

void opcua::ClientConfig::setLogger ( LogFunction func)

Set custom log function.

Does nothing if the passed function is empty or a nullptr.

Examples
client_find_servers.cpp.

Referenced by opcua::Client::setLogger().

◆ setTimeout()

void opcua::ClientConfig::setTimeout ( uint32_t milliseconds)
noexcept

Set response timeout in milliseconds.

Referenced by opcua::Client::setTimeout().

◆ setUserIdentityToken() [1/4]

void opcua::ClientConfig::setUserIdentityToken ( const AnonymousIdentityToken & token)

Set anonymous identity token.

Examples
client_connect.cpp.

Referenced by opcua::Client::setUserIdentityToken().

◆ setUserIdentityToken() [2/4]

void opcua::ClientConfig::setUserIdentityToken ( const UserNameIdentityToken & token)

Set username/password identity token.

◆ setUserIdentityToken() [3/4]

void opcua::ClientConfig::setUserIdentityToken ( const X509IdentityToken & token)

Set X.509 identity token.

◆ setUserIdentityToken() [4/4]

void opcua::ClientConfig::setUserIdentityToken ( const IssuedIdentityToken & token)

Set issued identity token.

◆ setSecurityMode()

void opcua::ClientConfig::setSecurityMode ( MessageSecurityMode mode)
noexcept

Set message security mode.

Referenced by opcua::Client::setSecurityMode().