The UaTrustListObject class manges a UA Client side interaction with a TrustListType object in a server.
More...
#include <uatrustlistobject.h>
|
| 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 UaStatus | saveTrustListAsFiles (const UaString &sCertificateRevocationListLocation, const UaString &sCertificateTrustListLocation, const UaString &sIssuersRevocationListLocation, const UaString &sIssuersCertificatesLocation, const UaTrustListDataType &trustListData, bool mergeTrustList=false) |
| 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...
|
|
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.
UaClientSdk::UaTrustListObject::UaTrustListObject |
( |
UaSession * |
pSession | ) |
|
Constructs a TrustList object used to access an object of type TrustListType.
- Parameters
-
[in] | pSession | The UaSession object used to communicate with the server |
Used to add a certificate to the trust list in the server.
- Parameters
-
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | trustListObjectNodeId | NodeId of the TrustListType object in the server |
[in] | certificate | The DER encoded Certificate to add. |
[in] | isTrustedCertificate | If 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] | sCertificateRevocationListLocation | The folder where revocation lists for trusted CAs should be stored |
[in] | sCertificateTrustListLocation | The folder where certificates of trusted applications and trusted CAs should be stored |
[in] | sIssuersRevocationListLocation | The folder where revocation lists for issuer CAs should be stored |
[in] | sIssuersCertificatesLocation | The 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 |
| masks | Indicates 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] | trustListData | The trust list content loaded from files |
Used to read the content of the trust list in the server.
- Parameters
-
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | trustListObjectNodeId | NodeId of the TrustListType object in the server |
| masks | Indicates 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] | trustListData | The 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] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | trustListObjectNodeId | NodeId of the TrustListType object in the server |
[in] | thumbprint | The SHA1 hash of the Certificate to remove. |
[in] | isTrustedCertificate | If 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, |
|
|
bool |
mergeTrustList = false |
|
) |
| |
|
static |
Helper function to save the TrustList as files.
- Parameters
-
[in] | sCertificateRevocationListLocation | The folder where revocation lists for trusted CAs should be stored |
[in] | sCertificateTrustListLocation | The folder where certificates of trusted applications and trusted CAs should be stored |
[in] | sIssuersRevocationListLocation | The folder where revocation lists for issuer CAs should be stored |
[in] | sIssuersCertificatesLocation | The 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] | trustListData | The trust list content to save as files |
[in] | mergeTrustList | Flag used to force a merge of the existing trust list content with the new trust list content |
Used to write the content of the trust list in the server.
- Parameters
-
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | trustListObjectNodeId | NodeId of the TrustListType object in the server |
[in] | trustListData | The trust list content to write to the server |
[in] | maxWriteLength | The maximum length for one write operation to the server. If 0 is passed in, the default serializer settings are used. |
[out] | applyChangesRequired | A 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:
- C:/work/uasdkcpp/src/uaclient/uaclientcpp/uatrustlistobject.h
- C:/work/uasdkcpp/src/uaclient/uaclientcpp/uatrustlistobject.cpp