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

The UaTrustListObject class manges a UA Client side interaction with a TrustListType object in a server. More...

#include <uatrustlistobject.h>

Public Member Functions

 UaTrustListObject (UaSession *pSession)
 Constructs a TrustList object used to access an object of type TrustListType. More...
 
virtual ~UaTrustListObject ()
 Destroys the TrustList object.
 
UaStatus readTrustList (ServiceSettings &serviceSettings, const UaNodeId &trustListObjectNodeId, OpcUa_UInt32 masks, UaTrustListDataType &trustListData)
 Used to read the content of the trust list in the server. More...
 
UaStatus writeTrustList (ServiceSettings &serviceSettings, const UaNodeId &trustListObjectNodeId, const UaTrustListDataType &trustListData, OpcUa_UInt32 maxWriteLength, OpcUa_Boolean &applyChangesRequired)
 Used to write the content of the trust list in the server. More...
 
UaStatus addCertificate (ServiceSettings &serviceSettings, const UaNodeId &trustListObjectNodeId, const UaByteString &certificate, OpcUa_Boolean isTrustedCertificate)
 Used to add a certificate to the trust list in the server. More...
 
UaStatus removeCertificate (ServiceSettings &serviceSettings, const UaNodeId &trustListObjectNodeId, const UaString &thumbprint, OpcUa_Boolean isTrustedCertificate)
 Used to remove a certificate from the trust list in the server. More...
 

Static Public Member Functions

static UaStatus saveTrustListAsFiles (const UaString &sCertificateRevocationListLocation, const UaString &sCertificateTrustListLocation, const UaString &sIssuersRevocationListLocation, const UaString &sIssuersCertificatesLocation, const UaTrustListDataType &trustListData)
 Helper function to save the TrustList as files. More...
 
static void loadTrustListFromFiles (const UaString &sCertificateRevocationListLocation, const UaString &sCertificateTrustListLocation, const UaString &sIssuersRevocationListLocation, const UaString &sIssuersCertificatesLocation, OpcUa_UInt32 masks, UaTrustListDataType &trustListData)
 Helper function to loead the TrustList from files. More...
 

Detailed Description

The UaTrustListObject class manges a UA Client side interaction with a TrustListType object in a server.

The class hides all details necessary for the trust list access and provides simple methods to read or write the content of a TrustListType object in a server.

Constructor & Destructor Documentation

UaClientSdk::UaTrustListObject::UaTrustListObject ( UaSession pSession)

Constructs a TrustList object used to access an object of type TrustListType.

Parameters
[in]pSessionThe UaSession object used to communicate with the server

Member Function Documentation

UaStatus UaClientSdk::UaTrustListObject::addCertificate ( ServiceSettings serviceSettings,
const UaNodeId trustListObjectNodeId,
const UaByteString certificate,
OpcUa_Boolean  isTrustedCertificate 
)

Used to add a certificate to the trust list in the server.

Parameters
[in,out]serviceSettingsThe general service settings like timeout. See ServiceSettings for more details.
[in]trustListObjectNodeIdNodeId of the TrustListType object in the server
[in]certificateThe DER encoded Certificate to add.
[in]isTrustedCertificateIf TRUE the Certificate is added to the Trusted Certificates List. If FALSE the Certificate is added to the Issuer Certificates List.
void UaClientSdk::UaTrustListObject::loadTrustListFromFiles ( const UaString sCertificateRevocationListLocation,
const UaString sCertificateTrustListLocation,
const UaString sIssuersRevocationListLocation,
const UaString sIssuersCertificatesLocation,
OpcUa_UInt32  masks,
UaTrustListDataType trustListData 
)
static

Helper function to loead the TrustList from files.

Parameters
[in]sCertificateRevocationListLocationThe folder where revocation lists for trusted CAs should be stored
[in]sCertificateTrustListLocationThe folder where certificates of trusted applications and trusted CAs should be stored
[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
masksIndicates the parts of the TrustList that are include in the file to read.
The mask is an 32-bit unsigned integer used as bit mask with the structure defined in the following table:
Field Bit Value Description
TrustedCertificates 0 1 The TrustedCertificates are provided.
TrustedCrls 1 2 The TrustedCrls are provided.
IssuerCertificates 2 4 The IssuerCertificates are provided.
IssuerCrls 3 8 The IssuerCrls are provided.
All 15 All fields are provided.
[in]trustListDataThe trust list content loaded from files
UaStatus UaClientSdk::UaTrustListObject::readTrustList ( ServiceSettings serviceSettings,
const UaNodeId trustListObjectNodeId,
OpcUa_UInt32  masks,
UaTrustListDataType trustListData 
)

Used to read the content of the trust list in the server.

Parameters
[in,out]serviceSettingsThe general service settings like timeout. See ServiceSettings for more details.
[in]trustListObjectNodeIdNodeId of the TrustListType object in the server
masksIndicates the parts of the TrustList that are include in the file to read.
The mask is an 32-bit unsigned integer used as bit mask with the structure defined in the following table:
Field Bit Value Description
TrustedCertificates 0 1 The TrustedCertificates are provided.
TrustedCrls 1 2 The TrustedCrls are provided.
IssuerCertificates 2 4 The IssuerCertificates are provided.
IssuerCrls 3 8 The IssuerCrls are provided.
All 15 All fields are provided.
[in]trustListDataThe trust list content read from the server
UaStatus UaClientSdk::UaTrustListObject::removeCertificate ( ServiceSettings serviceSettings,
const UaNodeId trustListObjectNodeId,
const UaString thumbprint,
OpcUa_Boolean  isTrustedCertificate 
)

Used to remove a certificate from the trust list in the server.

Parameters
[in,out]serviceSettingsThe general service settings like timeout. See ServiceSettings for more details.
[in]trustListObjectNodeIdNodeId of the TrustListType object in the server
[in]thumbprintThe SHA1 hash of the Certificate to remove.
[in]isTrustedCertificateIf TRUE the Certificate is removed from the Trusted Certificates List. If FALSE the Certificate is removed from the Issuer Certificates List.
UaStatus UaClientSdk::UaTrustListObject::saveTrustListAsFiles ( const UaString sCertificateRevocationListLocation,
const UaString sCertificateTrustListLocation,
const UaString sIssuersRevocationListLocation,
const UaString sIssuersCertificatesLocation,
const UaTrustListDataType trustListData 
)
static

Helper function to save the TrustList as files.

Parameters
[in]sCertificateRevocationListLocationThe folder where revocation lists for trusted CAs should be stored
[in]sCertificateTrustListLocationThe folder where certificates of trusted applications and trusted CAs should be stored
[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
[in]trustListDataThe trust list content to save as files
UaStatus UaClientSdk::UaTrustListObject::writeTrustList ( ServiceSettings serviceSettings,
const UaNodeId trustListObjectNodeId,
const UaTrustListDataType trustListData,
OpcUa_UInt32  maxWriteLength,
OpcUa_Boolean &  applyChangesRequired 
)

Used to write the content of the trust list in the server.

Parameters
[in,out]serviceSettingsThe general service settings like timeout. See ServiceSettings for more details.
[in]trustListObjectNodeIdNodeId of the TrustListType object in the server
[in]trustListDataThe trust list content to write to the server
[in]maxWriteLengthThe maximum length for one write operation to the server. If 0 is passed in, the default serializer settings are used.
[out]applyChangesRequiredA flag indicating whether a the ApplyChanges Method on the ServerConfig object must be called before the new TrustList will be used by the Server.

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