Hkdf..::..Expand Method (HashAlgorithmName, array<Byte>[]()[][], Int32, array<Nullable<(Of <(<'Byte>)>)>>[]()[][])
Expands the provided pseudorandom key into an output keying material of the desired length using optional 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.
- prk
- Type: array<Byte>[]()[][]
The pseudorandom key. Must be at least as long as the output of the hash algorithm, i.e.: MD5 - 16 bytes, SHA1 - 20, SHA256 - 32, SHA384 - 48, SHA512 - 64.
- outputLength
- Type: Int32
The desired length of the generated output keying material in bytes. Minimum value - 1. Maximum value - 255 times the size of the hash algorithm output, i.e.: MD5 - 4080, SHA1 - 5100, SHA256 - 8160, SHA384 - 12240, SHA512 - 16320.
Return Value
The output keying material.Exceptions
Exception | Condition |
---|---|
[ArgumentNullException] | The argument prk is null. |
[ArgumentOutOfRangeException] | The hash algorithm specified in the parameter hashAlgorithmName is not supported or the value of the parameter outputLength is invalid (either too small or too large). |
[ArgumentException] | The length of the prk is less than the length of the output of the hash algorithm. |