# OpcApplicationInstance&lt;TTransport, TSecurity&gt; Members

> Reference: Represents the base class of an OPC UA application instance (e.g. a client or a server) using the transport and security settings of the types specified.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcApplicationInstance&lt;TTransport, TSecurity&gt;</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Constructors

### OpcApplicationInstance

<span class="api-meta">protected</span>

Initializes a new instance of the [OpcApplicationInstance&lt;TTransport, TSecurity&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/) class for an application of the type specified.

<div class="api-signature" data-lang="csharp">

```csharp
protected OpcApplicationInstance(OpcApplicationType type)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Sub New(type As OpcApplicationType)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcApplicationType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationtype/) | The type of the application. |

**Remarks**

The constructor calls the abstract methods [CreateTransport](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#createtransport) and [CreateSecurity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#createsecurity), so that an implementation in a derived class is called before the constructor of the derived class has run.

## Properties

### ApplicationName

<span class="api-meta">virtual</span>

Gets or sets the name of the application.

<div class="api-signature" data-lang="csharp">

```csharp
public virtual string ApplicationName { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Overridable Property ApplicationName As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The name of the application. The default value is "OPC Application" in case there is no entry assembly available; otherwise the value of the [AssemblyTitleAttribute](https://learn.microsoft.com/dotnet/api/system.reflection.assemblytitleattribute) of the entry assembly.

**Implements**

[ApplicationName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#applicationname)

**Remarks**

The name does not have to be unique. The value of this property is also used as the [SubjectName](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2.subjectname) of the application certificate whenever an application certificate is to be created/looked-up (from the application certificates store).

### ApplicationUri

Gets or sets the URI of the application.

<div class="api-signature" data-lang="csharp">

```csharp
public Uri ApplicationUri { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property ApplicationUri As Uri
```

</div>

**Property value**

[Uri](https://learn.microsoft.com/dotnet/api/system.uri)

The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) or a null reference (Nothing in Visual Basic) which uniquely identifies the application instance.

**Implements**

[ApplicationUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#applicationuri)

**Remarks**

In case there the value of this property is a null reference (Nothing in Visual Basic) the URI of the application is determined by the subject alternate name of the application certificate used. In case there an application certificate is to be automatically created (if [Certificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#certificate) is unspecified and [AutoCreateCertificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestores/members#autocreatecertificate) is equals true), this value is used to define the certificates subject alternate name.

If there exists already an application certificate the value of this property is replaced with the subject alternate name in the certificate. Nevertheless another URI has been manually configured.

### Certificate

Gets or sets the application certificate representing the applications identity. Changing the application certificate using this property will change the [PathType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestoreinfo/members#pathtype) of the [ApplicationStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestores/members#applicationstore) to [System](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestorepathtype/#system).

<div class="api-signature" data-lang="csharp">

```csharp
public X509Certificate2 Certificate { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property Certificate As X509Certificate2
```

</div>

**Property value**

[X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2)

An instance of the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) class used to identify the application instance.

**Implements**

[Certificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#certificate)

### CertificateStores

Gets the [OpcCertificateStores](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestores/) instance used to maintain the different certificate stores used by the server application.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcCertificateStores CertificateStores { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property CertificateStores As OpcCertificateStores
```

</div>

**Property value**

[OpcCertificateStores](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestores/)

An instance of the [OpcCertificateStores](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestores/) class used by the [IOpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/) to setup and maintain the certificate stores and their certificates used by the application.

**Implements**

[CertificateStores](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#certificatestores)

### Configuration

<span class="api-meta">virtual</span>

Gets or sets an instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) class which is used as a low-level representation of the code/file based application configuration.

<div class="api-signature" data-lang="csharp">

```csharp
public virtual OpcApplicationConfiguration Configuration { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Public Overridable Property Configuration As OpcApplicationConfiguration
```

</div>

**Property value**

[OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/)

An instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) class configured with the application specific setup to use. An assignment of a null reference (Nothing in Visual Basic) will lead to the creation of a new instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) class with all defaults typically used by this type of applications.

**Implements**

[Configuration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#configuration)

### Namespaces

<span class="api-meta">abstract · since v2.12</span>

Gets a read-only collection of namespaces used by the application instance.

<div class="api-signature" data-lang="csharp">

```csharp
public abstract OpcReadOnlyNamespaceCollection Namespaces { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public MustOverride ReadOnly Property Namespaces As OpcReadOnlyNamespaceCollection
```

</div>

**Property value**

[OpcReadOnlyNamespaceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynamespacecollection/)

An instance of the [OpcReadOnlyNamespaceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynamespacecollection/) class with [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) items for each 'NamespaceUri' known/used.

**Implements**

[Namespaces](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#namespaces)

### ProductUri

<span class="api-meta">since v2.10</span>

Gets or sets the URI of the product.

<div class="api-signature" data-lang="csharp">

```csharp
public Uri ProductUri { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property ProductUri As Uri
```

</div>

**Property value**

[Uri](https://learn.microsoft.com/dotnet/api/system.uri)

The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) or a null reference (Nothing in Visual Basic) which uniquely identifies the product.

**Implements**

[ProductUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#producturi)

**Remarks**

In case there the value of this property is a null reference (Nothing in Visual Basic) the URI of the product is determined by the [AssemblyCompanyAttribute](https://learn.microsoft.com/dotnet/api/system.reflection.assemblycompanyattribute) and [AssemblyProductAttribute](https://learn.microsoft.com/dotnet/api/system.reflection.assemblyproductattribute) used.

### Security

Gets the `TSecurity` instance used to maintain the different security options used by the application instance.

<div class="api-signature" data-lang="csharp">

```csharp
public TSecurity Security { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Security As TSecurity
```

</div>

**Property value**

TSecurity

An instance of the `TSecurity` class used by the application instance to setup and maintain the different security options.

### SystemContext

<span class="api-meta">abstract · since v2.11</span>

Gets the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) which is used to store the context sensitive data and configuration used by the current application instance.

<div class="api-signature" data-lang="csharp">

```csharp
public abstract OpcContext SystemContext { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public MustOverride ReadOnly Property SystemContext As OpcContext
```

</div>

**Property value**

[OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/)

An instance of the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) class which might be at least [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#empty).

**Implements**

[SystemContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#systemcontext)

### Transport

Gets the `TTransport` instance used to maintain the different transport options used by the application instance.

<div class="api-signature" data-lang="csharp">

```csharp
public TTransport Transport { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Transport As TTransport
```

</div>

**Property value**

TTransport

An instance of the `TTransport` class used by the application instance to setup and maintain the different transport options.

## Methods

### ChangeApplicationState

<span class="api-meta">protected · since v2.50</span>

Changes the [ApplicationState](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#applicationstate) of this instance.

<div class="api-signature" data-lang="csharp">

```csharp
protected void ChangeApplicationState(OpcApplicationState newState)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Sub ChangeApplicationState(newState As OpcApplicationState)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `newState` | [OpcApplicationState](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationstate/) | The new [OpcApplicationState](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationstate/) to change to. |

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The [Created](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationstate/#created) is restricted as the initial state only. |

### CreateSecurity

<span class="api-meta">protected · abstract</span>

When implemented in a derived class; creates and initializes a new instance of the `TSecurity` which is used for the [Security](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#security) property.

<div class="api-signature" data-lang="csharp">

```csharp
protected abstract TSecurity CreateSecurity()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected MustOverride Function CreateSecurity() As TSecurity
```

</div>

**Returns**

TSecurity

A new instance of the type specified by `TSecurity`.

### CreateTransport

<span class="api-meta">protected · abstract</span>

When implemented in a derived class; creates and initializes a new instance of the `TTransport` which is used for the [Transport](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#transport) property.

<div class="api-signature" data-lang="csharp">

```csharp
protected abstract TTransport CreateTransport()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected MustOverride Function CreateTransport() As TTransport
```

</div>

**Returns**

TTransport

A new instance of the type specified by `TTransport`.

### DenyIfIsDisposed

<span class="api-meta">protected</span>

Verifies whether the current [IOpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/) instance has been already disposed of. In the case there `isDisposed` is equals true an [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) will be thrown.

<div class="api-signature" data-lang="csharp">

```csharp
protected void DenyIfIsDisposed()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Sub DenyIfIsDisposed()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

### Dispose

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [Dispose()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#dispose-noparams) | Releases all resources used by the [IOpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/). |
| [Dispose(bool)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#dispose-system-boolean)<span class="api-meta">protected · virtual</span> | Releases the unmanaged resources used by the [IOpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/) and optionally releases the managed resources. |

#### Dispose()

Releases all resources used by the [IOpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/).

<div class="api-signature" data-lang="csharp">

```csharp
public void Dispose()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Dispose()
```

</div>

**Implements**

[Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)

#### Dispose(bool)

<span class="api-meta">protected · virtual</span>

Releases the unmanaged resources used by the [IOpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/) and optionally releases the managed resources.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void Dispose(bool disposing)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub Dispose(disposing As Boolean)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `disposing` | [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) | The value true to release both managed and unmanaged resources; otherwise the value false to release only unmanaged resources. |

### IsAddressSupported

<span class="api-meta">static · 2 overloads</span>

| Overload | Description |
|---|---|
| [IsAddressSupported(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#isaddresssupported-system-string)<span class="api-meta">static</span> | Determines if the `address` specified is supported. |
| [IsAddressSupported(Uri)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#isaddresssupported-system-uri)<span class="api-meta">static</span> | Determines if the `address` specified is supported. |

#### IsAddressSupported(string)

<span class="api-meta">static</span>

Determines if the `address` specified is supported.

<div class="api-signature" data-lang="csharp">

```csharp
public static bool IsAddressSupported(string address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function IsAddressSupported(address As String) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [String](https://learn.microsoft.com/dotnet/api/system.string) | A string representing the [Uri](https://learn.microsoft.com/dotnet/api/system.uri) to evaluate. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the `address` is supported; otherwise the value false.

**Remarks**

The value of the `address` parameter can also be a null reference (Nothing in Visual Basic) or an empty string. In both cases the result will be false.

#### IsAddressSupported(Uri)

<span class="api-meta">static</span>

Determines if the `address` specified is supported.

<div class="api-signature" data-lang="csharp">

```csharp
public static bool IsAddressSupported(Uri address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function IsAddressSupported(address As Uri) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) | The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) to evalatuate. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the `address` is supported; otherwise the value false.

**Remarks**

The value the `address` parameter can be a null reference (Nothing in Visual Basic). In this case the result of the will be false.

### OnCertificateRequested

<span class="api-meta">protected · virtual</span>

Raises the [CertificateRequested](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#certificaterequested) event of the application instance.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnCertificateRequested(
    OpcCertificateRequestedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnCertificateRequested(
    e As OpcCertificateRequestedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcCertificateRequestedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventargs/) | The event data. |

### OnCertificateValidationFailed

<span class="api-meta">protected · virtual</span>

Raises the [CertificateValidationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#certificatevalidationfailed) event of the application instance.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnCertificateValidationFailed(
    OpcCertificateValidationFailedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnCertificateValidationFailed(
    e As OpcCertificateValidationFailedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcCertificateValidationFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationfailedeventargs/) | The event data. |

### Setup

<span class="api-meta">protected · virtual</span>

Prepares the `configuration` specified before the application connects to a server or starts: updates the application certificate (see [CertificateRequested](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#certificaterequested)) and validates the configuration.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void Setup(OpcApplicationConfiguration configuration)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Protected Overridable Sub Setup(configuration As OpcApplicationConfiguration)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `configuration` | [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) | The configuration used to connect or to start. |

**Exceptions**

| Exception | Condition |
|---|---|
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The application certificate could not be created or the configuration is invalid. |

## Events

### CertificateRequested

Occurs when the certificate of this application instance could not automatically determined using the information of this application instance. This event is when used to query the certificate to use for the application instance. Additionally use this event to determine the case that an appropriate instance certificate is missing and in case there [AutoCreateCertificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestores/members#autocreatecertificate) of [CertificateStores](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#certificatestores) is equals true a new certificate is being created automatically after the event has been processed (and this may take some time).

<div class="api-signature" data-lang="csharp">

```csharp
public event OpcCertificateRequestedEventHandler CertificateRequested
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event CertificateRequested As OpcCertificateRequestedEventHandler
```

</div>

**Event type**

[OpcCertificateRequestedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventhandler/)

**Implements**

[CertificateRequested](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#certificaterequested)

**Remarks**

The event occurs when a server starts or a client connects, with one of the following [Reason](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventargs/members#reason) values:

- [Missing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#missing), [MissingPrivateKey](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#missingprivatekey), [InvalidThumbrint](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#invalidthumbrint), [MissingApplicationUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#missingapplicationuri) and, for a server, [InvalidDomain](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#invaliddomain): the certificate cannot be used. A new certificate is created if [AutoCreateCertificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventargs/members#autocreatecertificate) is true and [AlternativeCertificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventargs/members#alternativecertificate) is a null reference (Nothing in Visual Basic). Another certificate provided using [AlternativeCertificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventargs/members#alternativecertificate) is used instead.
- [Invalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#invalid), [UseNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#usenotallowed), [Revoked](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#revoked), [TimeInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#timeinvalid), [IssuerUseNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#issuerusenotallowed), [IssuerRevoked](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#issuerrevoked) and [IssuerTimeInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationresult/#issuertimeinvalid): the certificate exists, but other applications refuse it (e.g. because it has expired). The certificate is never replaced automatically: if [AlternativeCertificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventargs/members#alternativecertificate) is a null reference (Nothing in Visual Basic) or the original certificate, the application keeps using it; another certificate provided using [AlternativeCertificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificaterequestedeventargs/members#alternativecertificate) is used instead.

A certificate which is not trusted yet does not raise the event; it is added to the [TrustedPeerStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatestores/members#trustedpeerstore).

### CertificateValidationFailed

Occurs when the validation of a opponent application instance certificate does not fulfill the requirements for valid and trusted certificates.

<div class="api-signature" data-lang="csharp">

```csharp
public event OpcCertificateValidationFailedEventHandler CertificateValidationFailed
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event CertificateValidationFailed As OpcCertificateValidationFailedEventHandler
```

</div>

**Event type**

[OpcCertificateValidationFailedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatevalidationfailedeventhandler/)

**Implements**

[CertificateValidationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/members#certificatevalidationfailed)

**Remarks**

This event can be used to complement the default validation of opponent application instance certificates. Using the event arguments it is possible to accept the certificate using different/custom circumstances.
