Skip to content

Reference

OpcCertificateRequestedEventArgs Members

Provides the event data for the CertificateRequested event.

Reference

OpcCertificateRequestedEventArgs Members ​

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

Inherits members from EventArgs.

Constructors ​

OpcCertificateRequestedEventArgs ​

Initializes a new instance of the OpcCertificateRequestedEventArgs class using the event data specified.

csharp
public OpcCertificateRequestedEventArgs(
    X509Certificate2 originalCertificate,
    OpcCertificateValidationResult reason,
    bool autoCreateCertificate)
vbnet
Public Sub New(
    originalCertificate As X509Certificate2,
    reason As OpcCertificateValidationResult,
    autoCreateCertificate As Boolean)

Parameters

NameTypeDescription
originalCertificateX509Certificate2The original X509Certificate2 information determined, evaluated and not used upon reason.
reasonOpcCertificateValidationResultOne of the members defined by the OpcCertificateValidationResult enumeration indicating the reson why the originalCertificate is not used.
autoCreateCertificateBooleanA value indicating whether a different certificate is created automatically if AlternativeCertificate is not defined.

Properties ​

AlternativeCertificate ​

Gets or sets the certificate the application uses instead of the OriginalCertificate.

csharp
public X509Certificate2 AlternativeCertificate { get; set; }
vbnet
Public Property AlternativeCertificate As X509Certificate2

Property value

X509Certificate2

The certificate to use, or a null reference (Nothing in Visual Basic). The default value is the OriginalCertificate.

Remarks

A certificate other than the OriginalCertificate is used by the application for this and for later starts or connects; the event does not occur again for it unless it is not valid. The certificate must contain its private key.

If the value is a null reference (Nothing in Visual Basic), a new certificate is created if AutoCreateCertificate is true; otherwise the OriginalCertificate remains in use, if there is one.

AutoCreateCertificate ​

Gets value indicating whether the framework will automatically create a new X509Certificate2 instance by its own if AlternativeCertificate is a null reference (Nothing in Visual Basic).

csharp
public bool AutoCreateCertificate { get; }
vbnet
Public ReadOnly Property AutoCreateCertificate As Boolean

Property value

Boolean

The value true if the framework will automatically create a new X509Certificate2 by its own if AlternativeCertificate is a null reference (Nothing in Visual Basic); otherwise the value false.

Remarks

The value is always false for a Reason which indicates that other applications refuse the certificate (e.g. TimeInvalid), because such a certificate is never replaced automatically (see CertificateRequested).

OriginalCertificate ​

Gets or sets the X509Certificate2 instance determined, evaluated and not used upon Reason.

csharp
public X509Certificate2 OriginalCertificate { get; }
vbnet
Public ReadOnly Property OriginalCertificate As X509Certificate2

Property value

X509Certificate2

The X509Certificate2 instance automatically determined or a null reference (Nothing in Visual Basic) in case there no certificate information could be found.

Reason ​

Gets one of the members defined by the OpcCertificateValidationResult enumeration which provides the outcome of the evaluation process of the OriginalCertificate information.

csharp
public OpcCertificateValidationResult Reason { get; }
vbnet
Public ReadOnly Property Reason As OpcCertificateValidationResult

Property value

OpcCertificateValidationResult

One of the members defined by the OpcCertificateValidationResult enumeration.

Remarks

The reasons which occur are listed at CertificateRequested.