Skip to content

Reference

OpcCertificateStoreInfo Members

Represents a certificate store, which provides access to the certificates stored at its Path.

Reference

OpcCertificateStoreInfo Members ​

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

Constructors ​

OpcCertificateStoreInfo ​

Initializes a new instance of the OpcCertificateStoreInfo class using the path and type specified.

csharp
public OpcCertificateStoreInfo(string path, OpcCertificateStoreType type)
vbnet
Public Sub New(path As String, type As OpcCertificateStoreType)

Parameters

NameTypeDescription
pathStringThe path of the certificate store.
typeOpcCertificateStoreTypeThe purpose of the certificate store.

Exceptions

ExceptionCondition
ArgumentExceptionThe path is an empty string.
ArgumentNullExceptionThe path is a null reference (Nothing in Visual Basic).

Remarks

The PathType is determined from the path: a path which starts with "LocalMachine\", "CurrentUser\", "User\" or "Service\" is a store of the operating system (System), any other path a directory (Directory).

Properties ​

Path ​

Gets or sets the path of the certificate store.

csharp
public string Path { get; set; }
vbnet
Public Property Path As String

Property value

String

The path of the certificate store.

Remarks

Setting the path does not change the PathType.

PathType ​

Gets or sets the kind of the Path of the certificate store.

csharp
public OpcCertificateStorePathType PathType { get; set; }
vbnet
Public Property PathType As OpcCertificateStorePathType

Property value

OpcCertificateStorePathType

One of the members of OpcCertificateStorePathType.

Type ​

Gets the purpose of the certificate store.

csharp
public OpcCertificateStoreType Type { get; }
vbnet
Public ReadOnly Property Type As OpcCertificateStoreType

Property value

OpcCertificateStoreType

One of the members of OpcCertificateStoreType.

Methods ​

Add ​

Adds the certificate specified to the certificate store.

csharp
public void Add(X509Certificate2 certificate)
vbnet
Public Sub Add(certificate As X509Certificate2)

Parameters

NameTypeDescription
certificateX509Certificate2The certificate to add.

Exceptions

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

Clear ​

Removes all certificates from the certificate store.

csharp
public void Clear()
vbnet
Public Sub Clear()

Remarks

For a store of trusted certificates, the method also removes the certificates listed in its configuration.

Contains ​

2 overloads

OverloadDescription
Contains(X509Certificate2)Determines whether the certificate store contains a certificate with the thumbprint of the certificate specified.
Contains(string)Determines whether the certificate store contains a certificate with the thumbprint specified.

Contains(X509Certificate2) ​

Determines whether the certificate store contains a certificate with the thumbprint of the certificate specified.

csharp
public bool Contains(X509Certificate2 certificate)
vbnet
Public Function Contains(certificate As X509Certificate2) As Boolean

Parameters

NameTypeDescription
certificateX509Certificate2The certificate to locate.

Returns

Boolean

The value true if the store contains a certificate with the thumbprint of the certificate; otherwise the value false.

Exceptions

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

Contains(string) ​

Determines whether the certificate store contains a certificate with the thumbprint specified.

csharp
public bool Contains(string thumbprint)
vbnet
Public Function Contains(thumbprint As String) As Boolean

Parameters

NameTypeDescription
thumbprintStringThe thumbprint of the certificate to locate.

Returns

Boolean

The value true if the store contains a certificate with the thumbprint; otherwise the value false.

Exceptions

ExceptionCondition
ArgumentExceptionThe thumbprint is an empty string.
ArgumentNullExceptionThe thumbprint is a null reference (Nothing in Visual Basic).

GetCertificate ​

Gets the certificate with the thumbprint specified from the certificate store.

csharp
public OpcCertificateInfo GetCertificate(string thumbprint)
vbnet
Public Function GetCertificate(thumbprint As String) As OpcCertificateInfo

Parameters

NameTypeDescription
thumbprintStringThe thumbprint of the certificate to get.

Returns

OpcCertificateInfo

An OpcCertificateInfo representing the certificate, or a null reference (Nothing in Visual Basic) if the store does not contain a certificate with the thumbprint.

Exceptions

ExceptionCondition
ArgumentExceptionThe thumbprint is an empty string.
ArgumentNullExceptionThe thumbprint is a null reference (Nothing in Visual Basic).

GetCertificates ​

Gets the certificates of the certificate store.

csharp
public OpcCertificateInfo[] GetCertificates()
vbnet
Public Function GetCertificates() As OpcCertificateInfo()

Returns

OpcCertificateInfo[]

An array of the certificates of the store, each certificate once.

Remarks

For the store of the application certificate, the array also contains the configured application certificate. For a store of trusted certificates, it also contains the certificates listed in its configuration.

Remove ​

2 overloads

OverloadDescription
Remove(X509Certificate2)Removes the certificate with the thumbprint of the certificate specified from the certificate store.
Remove(string)Removes the certificate with the thumbprint specified from the certificate store.

Remove(X509Certificate2) ​

Removes the certificate with the thumbprint of the certificate specified from the certificate store.

csharp
public bool Remove(X509Certificate2 certificate)
vbnet
Public Function Remove(certificate As X509Certificate2) As Boolean

Parameters

NameTypeDescription
certificateX509Certificate2The certificate to remove.

Returns

Boolean

The value true if the certificate has been removed; otherwise the value false.

Exceptions

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

Remove(string) ​

Removes the certificate with the thumbprint specified from the certificate store.

csharp
public bool Remove(string thumbprint)
vbnet
Public Function Remove(thumbprint As String) As Boolean

Parameters

NameTypeDescription
thumbprintStringThe thumbprint of the certificate to remove.

Returns

Boolean

The value true if the certificate has been removed; otherwise the value false.

Exceptions

ExceptionCondition
ArgumentExceptionThe thumbprint is an empty string.
ArgumentNullExceptionThe thumbprint is a null reference (Nothing in Visual Basic).

ToString ​

override

Returns a string that represents the certificate store.

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

A string containing the Type, the PathType and the Path of the store.

Overrides

ToString()