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
loggerILogger<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
macKeyReadOnlySpan<byte>MacKey, taken from the start of the derived keying material.
contextKeyConfirmationContextThe MacData inputs.
macKeyConfirmationMacThe MAC function.
tagLengthBitLengthMacTagLen: at least 64 bits and at most the MAC output length.
strengthSecurityStrengthThe 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
receivedTagReadOnlySpan<byte>macKeyReadOnlySpan<byte>contextKeyConfirmationContextmacKeyConfirmationMactagLengthBitLengthstrengthSecurityStrength