Table of Contents

Class KeyConfirmationService

Namespace
Kdf108
Assembly
Kdf108.dll

The logging implementation of IKeyConfirmation. Stateless and thread-safe.

public sealed class KeyConfirmationService : IKeyConfirmation
Inheritance
KeyConfirmationService
Implements
Inherited Members

Constructors

KeyConfirmationService(ILogger<KeyConfirmationService>?)

The logging implementation of IKeyConfirmation. Stateless and thread-safe.

public KeyConfirmationService(ILogger<KeyConfirmationService>? logger = null)

Parameters

logger ILogger<KeyConfirmationService>

Methods

GenerateTag(ReadOnlySpan<byte>, KeyConfirmationContext, KeyConfirmationMac, BitLength, SecurityStrength)

Computes the tag for context.

public byte[] GenerateTag(ReadOnlySpan<byte> macKey, KeyConfirmationContext context, KeyConfirmationMac mac, BitLength tagLength, SecurityStrength strength)

Parameters

macKey ReadOnlySpan<byte>

MacKey, taken from the start of the derived keying material.

context KeyConfirmationContext

The MacData inputs.

mac KeyConfirmationMac

The MAC function.

tagLength BitLength

MacTagLen: at least 64 bits and at most the MAC output length.

strength SecurityStrength

The target security strength; MacKey must be at least this long (Table 5).

Returns

byte[]

VerifyTag(ReadOnlySpan<byte>, ReadOnlySpan<byte>, KeyConfirmationContext, KeyConfirmationMac, BitLength, SecurityStrength)

Recomputes the tag and compares it with receivedTag in constant time.

public bool VerifyTag(ReadOnlySpan<byte> receivedTag, ReadOnlySpan<byte> macKey, KeyConfirmationContext context, KeyConfirmationMac mac, BitLength tagLength, SecurityStrength strength)

Parameters

receivedTag ReadOnlySpan<byte>
macKey ReadOnlySpan<byte>
context KeyConfirmationContext
mac KeyConfirmationMac
tagLength BitLength
strength SecurityStrength

Returns

bool