# OpcEndpointIdentity Members

> Reference: Represents the identity of an endpoint, which consists of its URL and its security policy.

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

## Constructors

### OpcEndpointIdentity

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

| Overload | Description |
|---|---|
| [OpcEndpointIdentity(string, OpcSecurityPolicy)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/members#opcendpointidentity-system-string-opc-uafx-opcsecuritypolicy) | Initializes a new instance of the [OpcEndpointIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/) class using the `url` and `policy` specified. |
| [OpcEndpointIdentity(Uri, OpcSecurityPolicy)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/members#opcendpointidentity-system-uri-opc-uafx-opcsecuritypolicy) | Initializes a new instance of the [OpcEndpointIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/) class using the `url` and `policy` specified. |

**Exceptions (all overloads)**

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

#### OpcEndpointIdentity(string, OpcSecurityPolicy)

Initializes a new instance of the [OpcEndpointIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/) class using the `url` and `policy` specified.

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

```csharp
public OpcEndpointIdentity(string url, OpcSecurityPolicy policy)
```

</div>

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

```vbnet
Public Sub New(url As String, policy As OpcSecurityPolicy)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `url` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The URL of the endpoint. |
| `policy` | [OpcSecurityPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/) | The security policy of the endpoint. |

**Exceptions**

| Exception | Condition |
|---|---|
| [FormatException](https://learn.microsoft.com/dotnet/api/system.formatexception) | The `url` is not a valid absolute URI. |

#### OpcEndpointIdentity(Uri, OpcSecurityPolicy)

Initializes a new instance of the [OpcEndpointIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/) class using the `url` and `policy` specified.

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

```csharp
public OpcEndpointIdentity(Uri url, OpcSecurityPolicy policy)
```

</div>

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

```vbnet
Public Sub New(url As Uri, policy As OpcSecurityPolicy)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `url` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) | The URL of the endpoint. |
| `policy` | [OpcSecurityPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/) | The security policy of the endpoint. |

## Properties

### Policy

Gets the security policy of the endpoint.

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

```csharp
public OpcSecurityPolicy Policy { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Policy As OpcSecurityPolicy
```

</div>

**Property value**

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

The security policy of the endpoint.

### Url

Gets the URL of the endpoint.

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

```csharp
public Uri Url { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Url As Uri
```

</div>

**Property value**

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

The URL of the endpoint.

## Methods

### GetCurrent

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

Gets the identity of the endpoint through which the server is receiving the request processed by the current thread.

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

```csharp
public static OpcEndpointIdentity GetCurrent()
```

</div>

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

```vbnet
Public Shared Function GetCurrent() As OpcEndpointIdentity
```

</div>

**Returns**

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

The [OpcEndpointIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/) of the endpoint, or a null reference (Nothing in Visual Basic) if the current thread does not process a request of a secure channel.

### ToString

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

Returns a string that represents the endpoint.

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

```csharp
public override string ToString()
```

</div>

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

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

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

A string containing the [Url](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/members#url) and the URI of the [Policy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointidentity/members#policy).

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)
