# OpcSecurityPolicy Class

<dl class="api-definition">
<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>Members</dt>
<dd><a href="./members">OpcSecurityPolicy Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Describes the configuration used to secure the message exchange.

## Syntax

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

```csharp
public class OpcSecurityPolicy
```

</div>

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

```vbnet
Public Class OpcSecurityPolicy
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcSecurityPolicy**

## Constructors

| Name | Description |
|---|---|
| [OpcSecurityPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#opcsecuritypolicy)<span class="api-meta">3 overloads</span> | Initializes a new instance of the OpcSecurityPolicy class using the `mode` specified to determine the according [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#uri) and [Algorithm](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#algorithm) of the configuration to represent. |

## Fields

| Name | Description |
|---|---|
| [BaseUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#baseuri)<span class="api-meta">static</span> | Provides the base URI used by all security policies to refer to the according [OpcSecurityAlgorithm](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecurityalgorithm/) they use. |

## Properties

| Name | Description |
|---|---|
| [Algorithm](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#algorithm) | Gets the [OpcSecurityAlgorithm](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecurityalgorithm/) used to encrypt messages using the current OpcSecurityPolicy configuration. |
| [Level](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#level) | Gets an ordinal value to order and classify the current OpcSecurityPolicy accordingly to others and their security configuration. |
| [Mode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#mode) | Gets the mechanism used to secure the message exchange using the current OpcSecurityPolicy configuration. |
| [Uri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#uri) | Gets the URI which expresses the [Algorithm](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#algorithm) used for message encryption using the current OpcSecurityPolicy configuration. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
