Hkdf..::..DeriveKey Method (HashAlgorithmName, ReadOnlySpan<(Of <(<'Byte>)>)>, Span<(Of <(<'Byte>)>)>, ReadOnlySpan<(Of <(<'Byte>)>)>, ReadOnlySpan<(Of <(<'Byte>)>)>)
Derives the output keying material of the desired length from the input key material using the provided salt and context information.
Namespace:
SecretNET.CryptoAssembly: SecretNET (in SecretNET.dll)
Syntax
Parameters
- hashAlgorithmName
- Type: HashAlgorithmName
The hash algorithm to be used by the HMAC primitive. Supported hash functions: MD5, SHA1, SHA256, SHA384, SHA512.
- ikm
- Type: ReadOnlySpan<(Of <(<'Byte>)>)>
The input key material.
- output
- Type: Span<(Of <(<'Byte>)>)>
The buffer to receive the generated output keying material (OKM). The OKM produced is of the same size as the buffer. The minimum buffer size - 1 byte, maximum buffer size - 255 times the size of the hash algorithm output in bytes (i.e., MD5 - 4080, SHA1 - 5100, SHA256 - 8160, SHA384 - 12240, SHA512 - 16320).
- salt
- Type: ReadOnlySpan<(Of <(<'Byte>)>)>
The salt value.
- info
- Type: ReadOnlySpan<(Of <(<'Byte>)>)>
The optional context-specific information. If the argument is an empty span, the key derivation is performed without context information.
Exceptions
Exception | Condition |
---|---|
[ArgumentException] | The length of the output is either too small or too large. |
[ArgumentOutOfRangeException] | The hash algorithm specified in the parameter hashAlgorithmName is not supported. |