C++ Based OPC UA Client/Server SDK  1.5.5.355
UaClientSdk::ClientSecurityInfo Class Reference

The ClientSecurityInfo class contains the security related settings to create a secure channel. More...

#include <uaclientsdk.h>

Inherited by UaClientSdk::SessionSecurityInfo.

Public Member Functions

 ClientSecurityInfo ()
 Constructs a client security info object with initial values. More...
 
 ~ClientSecurityInfo ()
 Destroys the client security info object.
 
UaStatusCode initializePkiProviderOpenSSL (const UaString &sCertificateRevocationListLocation, const UaString &sCertificateTrustListLocation)
 Initialize the PKI provider to use the file based OpenSSL certificate store. More...
 
UaStatusCode initializePkiProviderOpenSSL (const UaString &sCertificateRevocationListLocation, const UaString &sCertificateTrustListLocation, const UaString &sIssuersRevocationListLocation, const UaString &sIssuersCertificatesLocation)
 Initialize the PKI provider to use the file based OpenSSL certificate store. More...
 
UaStatusCode loadClientCertificateOpenSSL (const UaString &sClientCertificateFile, const UaString &sClientPrivateKeyFile)
 Load client certificate and client private key using the file based OpenSSL certificate store. More...
 
UaStatusCode initializePkiProviderWindows (WindowsStoreLocation certificateStoreLocation, const UaString &sCertificateStoreName)
 Initialize the PKI provider to use the Windows certificate store. More...
 
UaStatusCode initializePkiProviderWindows (WindowsStoreLocation certificateStoreLocation, const UaString &sCertificateStoreName, const UaString &sIssuersCertificateStoreName)
 Initialize the PKI provider to use the Windows certificate store. More...
 
UaStatusCode loadClientCertificateWindows (const UaString &sCertificateThumbprint)
 Load client certificate and client private key using the Windows certificate store. More...
 
OpcUa_Void * pkiCfg ()
 Internally used function to provide the PKI provider for the UA Stack.
 
UaStatusCode initializePkiProviderHttps (const UaString &sHttpsIssuersRevocationListLocation, const UaString &sHttpsIssuersCertificatesLocation)
 Initialize the PKI provider to use for validating HTTPS certificates. More...
 
OpcUa_Void * pkiCfgHttps ()
 Internally used function to provide the PKI provider for the UA Stack used for HTTPS connections.
 

Public Attributes

UaString sSecurityPolicy
 The name of the security policy used for the connection. More...
 
OpcUa_MessageSecurityMode messageSecurityMode
 The message security mode used for the connection. More...
 
UaByteString clientCertificate
 Client certificate (public key). More...
 
UaByteString clientPrivateKey
 Client private key.
 

Detailed Description

The ClientSecurityInfo class contains the security related settings to create a secure channel.

Constructor & Destructor Documentation

UaClientSdk::ClientSecurityInfo::ClientSecurityInfo ( )

Constructs a client security info object with initial values.

sSecurityPolicy = OpcUa_SecurityPolicy_None
messageSecurityMode = OpcUa_MessageSecurityMode_None
No PKI provider

Member Function Documentation

UaStatusCode UaClientSdk::ClientSecurityInfo::initializePkiProviderHttps ( const UaString sHttpsIssuersRevocationListLocation,
const UaString sHttpsIssuersCertificatesLocation 
)

Initialize the PKI provider to use for validating HTTPS certificates.

This is needed when connecting to servers via HTTPS.

Returns
Status code
Parameters
[in]sHttpsIssuersRevocationListLocationThe folder where revocation lists for HTTPS CAs are stored.
[in]sHttpsIssuersCertificatesLocationThe folder where HTTPS certificates are stored.
UaStatusCode UaClientSdk::ClientSecurityInfo::initializePkiProviderOpenSSL ( const UaString sCertificateRevocationListLocation,
const UaString sCertificateTrustListLocation 
)

Initialize the PKI provider to use the file based OpenSSL certificate store.

Returns
Status code
Parameters
[in]sCertificateRevocationListLocationThe folder where revocation lists for trusted CAs should be stored. Files must be single DER encoded CRLs having the file ending .der or single PEM encoded CRLs having the file ending .pem.
[in]sCertificateTrustListLocationThe folder where certificates of trusted applications and trusted Certificate Autorities (CAs) should be stored. Files must be single DER encoded certificates having the file ending .der.
UaStatusCode UaClientSdk::ClientSecurityInfo::initializePkiProviderOpenSSL ( const UaString sCertificateRevocationListLocation,
const UaString sCertificateTrustListLocation,
const UaString sIssuersRevocationListLocation,
const UaString sIssuersCertificatesLocation 
)

Initialize the PKI provider to use the file based OpenSSL certificate store.

Returns
Status code
Parameters
[in]sCertificateRevocationListLocationThe folder where revocation lists for trusted CAs should be stored. Files must be single DER encoded CRLs having the file ending .der or single PEM encoded CRLs having the file ending .pem.
[in]sCertificateTrustListLocationThe folder where certificates of trusted applications and trusted Certificate Autorities (CAs) should be stored. Files must be single DER encoded certificates having the file ending .der.
[in]sIssuersRevocationListLocationThe folder where revocation lists for issuer CAs should be stored
[in]sIssuersCertificatesLocationThe folder where issuer certificates are stored. Issuer certificates are CA certificates necessary for the verification of the full trust chain of CA certificates in the trust list
UaStatusCode UaClientSdk::ClientSecurityInfo::initializePkiProviderWindows ( WindowsStoreLocation  certificateStoreLocation,
const UaString sCertificateStoreName 
)

Initialize the PKI provider to use the Windows certificate store.

Returns
Status code.
Parameters
[in]certificateStoreLocationWindows certificate store location used like Location_LocalMachine or Location_CurrentUser
[in]sCertificateStoreNameName of the windows certificate store where certificates of trusted applications and trusted CAs should be stored
UaStatusCode UaClientSdk::ClientSecurityInfo::initializePkiProviderWindows ( WindowsStoreLocation  certificateStoreLocation,
const UaString sCertificateStoreName,
const UaString sIssuersCertificateStoreName 
)

Initialize the PKI provider to use the Windows certificate store.

Returns
Status code.
Parameters
[in]certificateStoreLocationWindows certificate store location used like Location_LocalMachine or Location_CurrentUser
[in]sCertificateStoreNameName of the windows certificate store where certificates of trusted applications and trusted CAs should be stored
[in]sIssuersCertificateStoreNameName of the windows certificate store where issuer certificates are stored. Issuer certificates are CA certificates necessary for the verification of the full trust chain of CA certificates in the trust list
UaStatusCode UaClientSdk::ClientSecurityInfo::loadClientCertificateOpenSSL ( const UaString sClientCertificate,
const UaString sClientPrivateKey 
)

Load client certificate and client private key using the file based OpenSSL certificate store.

Returns
Status code.
Parameters
[in]sClientCertificatePath and file name of the client certificate (public key). Certificates have to be stored in DER format (with file extension .der).
[in]sClientPrivateKeyPath and file name of the client private key. The private key is encoded in PEM format (with .pem as file extension).
UaStatusCode UaClientSdk::ClientSecurityInfo::loadClientCertificateWindows ( const UaString sCertificateThumbprint)

Load client certificate and client private key using the Windows certificate store.

Returns
Status code.
Parameters
[in]sCertificateThumbprintName of the certificate in the Windows store. The CommonName field set during certificate generation is used as name.

Member Data Documentation

UaByteString UaClientSdk::ClientSecurityInfo::clientCertificate

Client certificate (public key).

This parameter can contain the leaf certificate only or a certificate chain.

OpcUa_MessageSecurityMode UaClientSdk::ClientSecurityInfo::messageSecurityMode

The message security mode used for the connection.

Possible values are:

  • OpcUa_MessageSecurityMode_None
  • OpcUa_MessageSecurityMode_Sign
  • OpcUa_MessageSecurityMode_SignAndEncrypt
UaString UaClientSdk::ClientSecurityInfo::sSecurityPolicy

The name of the security policy used for the connection.

Value String Representation
OpcUa_SecurityPolicy_None "http://opcfoundation.org/UA/SecurityPolicy#None" for security disabled
OpcUa_SecurityPolicy_Basic128Rsa15 "http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15"
OpcUa_SecurityPolicy_Basic256 "http://opcfoundation.org/UA/SecurityPolicy#Basic256"
OpcUa_SecurityPolicy_Basic256Sha256"http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"

The documentation for this class was generated from the following files: