#### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt 'index')
### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt 'Abblix\.Jwt')

## OctetJsonWebKey Class

Represents a Symmetric JSON Web Key \(JWK\) containing symmetric key material for algorithms like HMAC\.
Supports symmetric keys per RFC 7518 Section 6\.4\.

```csharp
public sealed record OctetJsonWebKey : Abblix.Jwt.JsonWebKey, System.IEquatable<Abblix.Jwt.OctetJsonWebKey>
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → [JsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebKey 'Abblix\.Jwt\.JsonWebKey') → OctetJsonWebKey

Implements [System\.IEquatable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')[OctetJsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.OctetJsonWebKey 'Abblix\.Jwt\.OctetJsonWebKey')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')
### Properties

## OctetJsonWebKey\.HasPrivateKey Property {#Abblix.Jwt.OctetJsonWebKey.HasPrivateKey}

Checks if the key contains private key material\.

```csharp
public override bool HasPrivateKey { get; }
```

#### Property Value
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')

## OctetJsonWebKey\.HasPublicKey Property {#Abblix.Jwt.OctetJsonWebKey.HasPublicKey}

Checks if the key contains public key material\.

```csharp
public override bool HasPublicKey { get; }
```

#### Property Value
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')

## OctetJsonWebKey\.KeyType Property {#Abblix.Jwt.OctetJsonWebKey.KeyType}

The key type identifier for symmetric \(Octet Sequence\) keys\. Always returns "oct"\.

```csharp
public override string KeyType { get; }
```

#### Property Value
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')

## OctetJsonWebKey\.KeyValue Property {#Abblix.Jwt.OctetJsonWebKey.KeyValue}

Symmetric Key Value \(k\)\. Used for oct \(Octet Sequence\) keys, which are symmetric keys
used in algorithms like HMAC\-SHA256, HMAC\-SHA384, and HMAC\-SHA512\.
This is a required parameter for symmetric keys and must be kept confidential\.

```csharp
public byte[]? KeyValue { get; set; }
```

#### Property Value
[System\.Byte](https://learn.microsoft.com/en-us/dotnet/api/system.byte 'System\.Byte')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')
### Methods

## OctetJsonWebKey\.Sanitize\(bool\) Method {#Abblix.Jwt.OctetJsonWebKey.Sanitize(bool)}

Prepares a sanitized version of the symmetric JWK that excludes the key value unless explicitly included\.

```csharp
public override Abblix.Jwt.JsonWebKey Sanitize(bool includePrivateKeys);
```
#### Parameters

###### `includePrivateKeys` [System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean') {#Abblix.Jwt.OctetJsonWebKey.Sanitize(bool).includePrivateKeys}

Whether to include the symmetric key value in the sanitized output\.

#### Returns
[JsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebKey 'Abblix\.Jwt\.JsonWebKey')  
A new instance of [OctetJsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.OctetJsonWebKey 'Abblix\.Jwt\.OctetJsonWebKey') with or without the key value based on the input parameter\.

#### Exceptions

[System\.InvalidOperationException](https://learn.microsoft.com/en-us/dotnet/api/system.invalidoperationexception 'System\.InvalidOperationException')  
Thrown when includePrivateKeys is true but the key contains no key value\.

### Remarks
For symmetric keys, the key value is always considered sensitive and should be treated
as private key material\.
