# otSecurityPolicy


`#include <openthread/dataset.h>`

Represents Security Policy.

## Summary

The `mReservedBit*Cleared` fields intentionally use inverted logic (`false`/`0` means the bit is set to `1` in the Security Policy TLV, and `true`/`1` means the bit is cleared to `0` in the TLV). Per the Thread specification, reserved bits in the Security Policy TLV default to `1`. Using inverted logic ensures backward compatibility when callers zero-initialize `https://openthread.io/reference/struct/ot-security-policy` (or `https://openthread.io/reference/struct/ot-operational-dataset`), so that unset reserved fields automatically encode to their specification-mandated default value of `1` in the TLV.

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1ac4d0eeb0c582df9789db1ed9d9223bd0` | `bool` Autonomous Enrollment is enabled. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1af1230493eff7006ce1d4526dfe2493ec` | `bool` Commercial Commissioning is enabled. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a093179dcad599d367024e613610ea598` | `bool` External Commissioner authentication is allowed. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1adf185ba81dec66e00b2319754fefa365` | `bool` Native Commissioning using PSKc is allowed. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a6d7c4a446214adebd056ee03448ee131` | `bool` Network Key Provisioning is enabled. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a58bccff09109c8b410d6edbe195f4035` | `bool` Non-CCM Routers enabled. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1af67eadb7c899744e8d3758e13f3d93ff` | `bool` Obtaining the Network Key for out-of-band commissioning is enabled. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a831cd8666adbe22f10ac1939e4cd4e40` | `bool` Reserved bit 10 (1 indicates bit is 0 in TLV) |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a20d43c70ca80b4e4093ffe242d816bd5` | `bool` Reserved bit 11 (1 indicates bit is 0 in TLV) |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a7e284b00f5dd1fa9eb3fbd1955864616` | `bool` Reserved bit 12 (1 indicates bit is 0 in TLV) |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a0d403e44d7f3a91ec85ac8e0fe83fd26` | `uint16_t` The value for thrKeyRotation in units of hours. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a46b0d352adbaebd4bc721ac00da62fe2` | `bool` Thread 1.0/1.1.x Routers are enabled. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1a42d9a493425437652b5726b19e621a8c` | `bool` ToBLE link is enabled. |
| `https://openthread.io/reference/struct/ot-security-policy#structot_security_policy_1ace13baca60ff7ae09d36ec7d52976a5e` | `uint8_t` Version-threshold for Routing. |

## Public attributes

### mAutonomousEnrollmentEnabled

```
bool otSecurityPolicy::mAutonomousEnrollmentEnabled
```
Autonomous Enrollment is enabled.

### mCommercialCommissioningEnabled

```
bool otSecurityPolicy::mCommercialCommissioningEnabled
```
Commercial Commissioning is enabled.

### mExternalCommissioningEnabled

```
bool otSecurityPolicy::mExternalCommissioningEnabled
```
External Commissioner authentication is allowed.

### mNativeCommissioningEnabled

```
bool otSecurityPolicy::mNativeCommissioningEnabled
```
Native Commissioning using PSKc is allowed.

### mNetworkKeyProvisioningEnabled

```
bool otSecurityPolicy::mNetworkKeyProvisioningEnabled
```
Network Key Provisioning is enabled.

### mNonCcmRoutersEnabled

```
bool otSecurityPolicy::mNonCcmRoutersEnabled
```
Non-CCM Routers enabled.

### mObtainNetworkKeyEnabled

```
bool otSecurityPolicy::mObtainNetworkKeyEnabled
```
Obtaining the Network Key for out-of-band commissioning is enabled.

### mReservedBit10Cleared

```
bool otSecurityPolicy::mReservedBit10Cleared
```
Reserved bit 10 (1 indicates bit is 0 in TLV)

### mReservedBit11Cleared

```
bool otSecurityPolicy::mReservedBit11Cleared
```
Reserved bit 11 (1 indicates bit is 0 in TLV)

### mReservedBit12Cleared

```
bool otSecurityPolicy::mReservedBit12Cleared
```
Reserved bit 12 (1 indicates bit is 0 in TLV)

### mRotationTime

```
uint16_t otSecurityPolicy::mRotationTime
```
The value for thrKeyRotation in units of hours.

### mRoutersEnabled

```
bool otSecurityPolicy::mRoutersEnabled
```
Thread 1.0/1.1.x Routers are enabled.

### mTobleLinkEnabled

```
bool otSecurityPolicy::mTobleLinkEnabled
```
ToBLE link is enabled.

### mVersionThresholdForRouting

```
uint8_t otSecurityPolicy::mVersionThresholdForRouting
```
Version-threshold for Routing.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).