Skip to content

Reference

OpcCertificateManager Members

Provides a set of static (Shared in Visual Basic) methods to manage certificates.

Reference

OpcCertificateManager Members ​

Type
OpcCertificateManager
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Methods ​

CreateCertificate ​

static · 4 overloads

OverloadDescription
CreateCertificate(IOpcApplicationInstance)staticCreates a new application instance certificate (in memory) using the application instance specified.
CreateCertificate(IOpcApplicationInstance, OpcCertificateStoreInfo)staticCreates a new application instance certificate using the instance specified, while the created certificate will be stored in the certificate store defined by store.
CreateCertificate(OpcCertificateSettings)staticCreates a new application instance certificate (in memory) using the certificate settings specified.
CreateCertificate(OpcCertificateSettings, OpcCertificateStoreInfo)staticCreates a new application instance certificate using the certificate settings specified, while the created certificate will be stored in the certificate store defined by store.

CreateCertificate(IOpcApplicationInstance) ​

static

Creates a new application instance certificate (in memory) using the application instance specified.

csharp
[CLSCompliant(false)]
public static X509Certificate2 CreateCertificate(
    IOpcApplicationInstance instance)
vbnet
<CLSCompliant(False)>
Public Shared Function CreateCertificate(
    instance As IOpcApplicationInstance) As X509Certificate2

Parameters

NameTypeDescription
instanceIOpcApplicationInstanceAn instance implementing the IOpcApplicationInstance interface from that the necessary certificate information is retrieved to create the certificate.

Returns

X509Certificate2

A new instance of the X509Certificate2 class representing the newly created certificate using the application instance information provided by instance.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe instance is a null reference (Nothing in Visual Basic).

CreateCertificate(IOpcApplicationInstance, OpcCertificateStoreInfo) ​

static

Creates a new application instance certificate using the instance specified, while the created certificate will be stored in the certificate store defined by store.

csharp
[CLSCompliant(false)]
public static X509Certificate2 CreateCertificate(
    IOpcApplicationInstance instance,
    OpcCertificateStoreInfo store)
vbnet
<CLSCompliant(False)>
Public Shared Function CreateCertificate(
    instance As IOpcApplicationInstance,
    store As OpcCertificateStoreInfo) As X509Certificate2

Parameters

NameTypeDescription
instanceIOpcApplicationInstanceAn instance implementing the IOpcApplicationInstance interface from that the necessary certificate information is retrieved to create the certificate.
storeOpcCertificateStoreInfoThe OpcCertificateStoreInfo of the certificate store to that the newly created certificate is to be added or a null reference (Nothing in Visual Basic) in case there the certificate is to be created in memory.

Returns

X509Certificate2

A new instance of the X509Certificate2 class representing the newly created certificate using the application instance information provided by instance.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe instance is a null reference (Nothing in Visual Basic).

CreateCertificate(OpcCertificateSettings) ​

static

Creates a new application instance certificate (in memory) using the certificate settings specified.

csharp
public static X509Certificate2 CreateCertificate(
    OpcCertificateSettings settings)
vbnet
Public Shared Function CreateCertificate(
    settings As OpcCertificateSettings) As X509Certificate2

Parameters

NameTypeDescription
settingsOpcCertificateSettingsThe OpcCertificateSettings to use to create the certificate.

Returns

X509Certificate2

A new instance of the X509Certificate2 class representing the newly created certificate using certificate settings specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe settings is a null reference (Nothing in Visual Basic).

CreateCertificate(OpcCertificateSettings, OpcCertificateStoreInfo) ​

static

Creates a new application instance certificate using the certificate settings specified, while the created certificate will be stored in the certificate store defined by store.

csharp
public static X509Certificate2 CreateCertificate(
    OpcCertificateSettings settings,
    OpcCertificateStoreInfo store)
vbnet
Public Shared Function CreateCertificate(
    settings As OpcCertificateSettings,
    store As OpcCertificateStoreInfo) As X509Certificate2

Parameters

NameTypeDescription
settingsOpcCertificateSettingsThe OpcCertificateSettings to use to create the certificate.
storeOpcCertificateStoreInfoThe OpcCertificateStoreInfo of the certificate store to that the newly created certificate is to be added or a null reference (Nothing in Visual Basic) in case there the certificate is to be created in memory.

Returns

X509Certificate2

A new instance of the X509Certificate2 class representing the newly created certificate using certificate settings specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe settings is a null reference (Nothing in Visual Basic).

LoadCertificate ​

static · 2 overloads

OverloadDescription
LoadCertificate(string)staticLoads the application instance certificate using the certificate file specified by filePath.
LoadCertificate(string, string)staticLoads the application instance certificate using the certificate file specified by filePath.

Exceptions (all overloads)

ExceptionCondition
ArgumentExceptionThe filePath is an empty string.
ArgumentNullExceptionThe filePath is a null reference (Nothing in Visual Basic).
FileNotFoundExceptionThe certificate file specified by filePath could not found.

LoadCertificate(string) ​

static

Loads the application instance certificate using the certificate file specified by filePath.

csharp
public static X509Certificate2 LoadCertificate(string filePath)
vbnet
Public Shared Function LoadCertificate(filePath As String) As X509Certificate2

Parameters

NameTypeDescription
filePathStringThe file path of the certificate file to load.

Returns

X509Certificate2

A new instance of the X509Certificate2 class representing the certificate specified by filePath.

LoadCertificate(string, string) ​

static

Loads the application instance certificate using the certificate file specified by filePath.

csharp
public static X509Certificate2 LoadCertificate(string filePath, string password)
vbnet
Public Shared Function LoadCertificate(
    filePath As String,
    password As String) As X509Certificate2

Parameters

NameTypeDescription
filePathStringThe file path of the certificate file load.
passwordStringThe optional password required to access the certificate or a null reference (Nothing in Visual Basic), if there is no password required by the certificate file.

Returns

X509Certificate2

A new instance of the X509Certificate2 class representing the certificate specified by filePath.

SaveCertificate ​

static

Saves the application instance certificate to the filePath specified.

csharp
public static void SaveCertificate(
    string filePath,
    X509Certificate2 certificate)
vbnet
Public Shared Sub SaveCertificate(
    filePath As String,
    certificate As X509Certificate2)

Parameters

NameTypeDescription
filePathStringThe full qualified path to the certificate file to write.
certificateX509Certificate2The X509Certificate2 instance its certificate information is to be written to the filePath.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe filePath or certificate is a null reference (Nothing in Visual Basic).

Events ​

QueryInstance ​

static · since v2.7

Occurs when a X509Certificate2 instance is to be created using several certificate and key information. This event can be used to create new X509Certificate2 instances while considering custom, platform and operating system related restrictions.

csharp
public static event OpcCertificateQueryInstanceEventHandler QueryInstance
vbnet
Public Shared Event QueryInstance As OpcCertificateQueryInstanceEventHandler

Event type

OpcCertificateQueryInstanceEventHandler