# OpcCertificateQueryInstanceEventArgs Members

> Reference: Provides the event data for the QueryInstance event.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcCertificateQueryInstanceEventArgs</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>

Inherits members from [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs).

## Constructors

### OpcCertificateQueryInstanceEventArgs

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

| Overload | Description |
|---|---|
| [OpcCertificateQueryInstanceEventArgs(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#opccertificatequeryinstanceeventargs-system-string) | Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `path` of the certificate file to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance representing the contents of the certificate file. |
| [OpcCertificateQueryInstanceEventArgs(string, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#opccertificatequeryinstanceeventargs-system-string-system-string) | Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `path` of the certificate file to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` specified) representing the contents of the certificate file. |
| [OpcCertificateQueryInstanceEventArgs(string, string, X509KeyStorageFlags)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#opccertificatequeryinstanceeventargs-system-string-system-string-system-security-cryptography-x509certificates-x509keystorageflags) | Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `path` of the certificate file to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` and `keyStorage` flags specified) representing the contents of the certificate file. |
| [OpcCertificateQueryInstanceEventArgs(byte\[\])](#opccertificatequeryinstanceeventargs-system-byte-array) | Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `rawData` of the certificate to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance representing the contents of the certificate data. |
| [OpcCertificateQueryInstanceEventArgs(byte\[\], string)](#opccertificatequeryinstanceeventargs-system-byte-array-system-string) | Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `rawData` of the certificate to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` specified) representing the contents of the certificate data. |
| [OpcCertificateQueryInstanceEventArgs(byte\[\], string, X509KeyStorageFlags)](#opccertificatequeryinstanceeventargs-system-byte-array-system-string-system-security-cryptography-x509certificates-x509keystorageflags) | Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `rawData` of the certificate to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` and `keyStorage` flags specified) representing the contents of the certificate data. |

#### OpcCertificateQueryInstanceEventArgs(string)

Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `path` of the certificate file to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance representing the contents of the certificate file.

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

```csharp
public OpcCertificateQueryInstanceEventArgs(string path)
```

</div>

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

```vbnet
Public Sub New(path As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `path` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The full qualified path of the certificate file to load. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `path` is an empty string. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `path` is a null reference (Nothing in Visual Basic). |

#### OpcCertificateQueryInstanceEventArgs(string, string)

Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `path` of the certificate file to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` specified) representing the contents of the certificate file.

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

```csharp
public OpcCertificateQueryInstanceEventArgs(string path, string password)
```

</div>

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

```vbnet
Public Sub New(path As String, password As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `path` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The full qualified path of the certificate file to load. |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password to use when reading the certificate file or a null reference (Nothing in Visual Basic) if there is not a password required to read the certificate. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `path` is an empty string. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `path` is a null reference (Nothing in Visual Basic). |

#### OpcCertificateQueryInstanceEventArgs(string, string, X509KeyStorageFlags)

Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `path` of the certificate file to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` and `keyStorage` flags specified) representing the contents of the certificate file.

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

```csharp
public OpcCertificateQueryInstanceEventArgs(
    string path,
    string password,
    X509KeyStorageFlags keyStorage)
```

</div>

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

```vbnet
Public Sub New(
    path As String,
    password As String,
    keyStorage As X509KeyStorageFlags)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `path` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The full qualified path of the certificate file to load. |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password to use when reading the certificate file or a null reference (Nothing in Visual Basic) if there is not a password required to read the certificate. |
| `keyStorage` | [X509KeyStorageFlags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags) | A combination of the values defined by the [X509KeyStorageFlags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags) enumeration indicating the way the key in the certificate is to be stored after the certificate has been loaded. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `path` is an empty string. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `path` is a null reference (Nothing in Visual Basic). |

#### OpcCertificateQueryInstanceEventArgs(byte\[\])

Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `rawData` of the certificate to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance representing the contents of the certificate data.

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

```csharp
public OpcCertificateQueryInstanceEventArgs(byte[] rawData)
```

</div>

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

```vbnet
Public Sub New(rawData As Byte())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `rawData` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The binary information of the certificate to load. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `rawData` is a null reference (Nothing in Visual Basic). |

#### OpcCertificateQueryInstanceEventArgs(byte\[\], string)

Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `rawData` of the certificate to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` specified) representing the contents of the certificate data.

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

```csharp
public OpcCertificateQueryInstanceEventArgs(byte[] rawData, string password)
```

</div>

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

```vbnet
Public Sub New(rawData As Byte(), password As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `rawData` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The binary information of the certificate to load. |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password to use when reading the certificate data or a null reference (Nothing in Visual Basic) if there is not a password required to read the certificate. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `rawData` is a null reference (Nothing in Visual Basic). |

#### OpcCertificateQueryInstanceEventArgs(byte\[\], string, X509KeyStorageFlags)

Initializes a new instance of the [OpcCertificateQueryInstanceEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/) class using the `rawData` of the certificate to load when creating the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance (using the `password` and `keyStorage` flags specified) representing the contents of the certificate data.

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

```csharp
public OpcCertificateQueryInstanceEventArgs(
    byte[] rawData,
    string password,
    X509KeyStorageFlags keyStorage)
```

</div>

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

```vbnet
Public Sub New(
    rawData As Byte(),
    password As String,
    keyStorage As X509KeyStorageFlags)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `rawData` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The binary information of the certificate to load. |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password to use when reading the certificate data or a null reference (Nothing in Visual Basic) if there is not a password required to read the certificate. |
| `keyStorage` | [X509KeyStorageFlags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags) | A combination of the values defined by the [X509KeyStorageFlags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags) enumeration indicating the way the key in the certificate is to be stored after the certificate has been loaded. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `rawData` is a null reference (Nothing in Visual Basic). |

## Properties

### Certificate

Gets or sets the [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance created either from the [Path](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#path) or [RawData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#rawdata) while using the [Password](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#password) and the [KeyStorage](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#keystorage) flags considering custom, platform and operating system related restrictions.

<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 initialized from the event data represented or a null reference (Nothing in Visual Basic) if still a [X509Certificate2](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2) instance to create.

### KeyStorage

Gets the [X509KeyStorageFlags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags) indicating the way the key in the certificate is to be stored after the certificate has been loaded.

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

```csharp
public X509KeyStorageFlags? KeyStorage { get; }
```

</div>

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

```vbnet
Public ReadOnly Property KeyStorage As X509KeyStorageFlags?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[X509KeyStorageFlags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags)&gt;

A combination of the values defined by the [X509KeyStorageFlags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags) enumeration or a null reference (Nothing in Visual Basic) if the default behaviour is to be used when storing the key information contained in the certificate to load.

### Password

Gets the password to use when reading the certificate data.

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

```csharp
public string Password { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Password As String
```

</div>

**Property value**

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

The password to use when reading the certificate data or a null reference (Nothing in Visual Basic) if there is not a password required to read the certificate.

### Path

Gets the full qualified path of the certificate file to load.

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

```csharp
public string Path { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Path As String
```

</div>

**Property value**

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

The full qualified path of the certificate file to load or a null reference (Nothing in Visual Basic) in case there the certificate is to be loaded using its [RawData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#rawdata).

### RawData

Gets the binary information of the certificate to load.

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

```csharp
public byte[] RawData { get; }
```

</div>

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

```vbnet
Public ReadOnly Property RawData As Byte()
```

</div>

**Property value**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

An array of [byte](https://learn.microsoft.com/dotnet/api/system.byte) values representing the binary information of the certificate to load or a null reference (Nothing in Visual Basic) in case there the certificate is to be loaded using the [Path](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificatequeryinstanceeventargs/members#path) to the certificate file to load.
