HKDF.Expand Method
Namespace: Rebex.Security.Cryptography
Assembly: Rebex.Security.dll (version 7.0.9083)
Expand(HashingAlgorithmId, Byte[], Int32, Byte[])
HKDF Expand function according to section 2.3 of RFC 5869.
Declaration
public static byte[] Expand(HashingAlgorithmId hashingAlgorithmId, byte[] prk, int outputLength, byte[] info = null)
Parameters
Type | Name | Description |
---|---|---|
HashingAlgorithmId | hashingAlgorithmId | The hash algorithm for HMAC operations. |
Byte[] | prk | A byte array that contains the pseudorandom key (the 'PRK' argument from RFC 5869).
Its length must be equal to or greater than the hash size of |
Int32 | outputLength | The length (in bytes) of the output keying material. This is the 'L' argument from RFC 5869.
The value must be between 1 and '255 * hash size of |
Byte[] | info | A byte array that contains the context and application-specific information. Can be null. This is the 'info' argument from RFC 5869. |
Returns
Type | Description |
---|---|
Byte[] | A byte array that contains the output keying material (the 'OKM' output from RFC 5869). |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentException | The |
See Also
Expand(HashingAlgorithmId, ArraySegment<Byte>, ArraySegment<Byte>, ArraySegment<Byte>)
HKDF Expand function according to section 2.3 of RFC 5869.
Declaration
public static void Expand(HashingAlgorithmId hashingAlgorithmId, ArraySegment<byte> prk, ArraySegment<byte> output, ArraySegment<byte> info)
Parameters
Type | Name | Description |
---|---|---|
HashingAlgorithmId | hashingAlgorithmId | The hash algorithm for HMAC operations. |
ArraySegment<Byte> | prk | An ArraySegment<T> that contains the pseudorandom key (the 'PRK' argument from RFC 5869).
Its length must be equal to or greater than the hash size of |
ArraySegment<Byte> | output | An ArraySegment<T> that will receive the output keying material (the 'OKM' output from RFC 5869).
The length of the |
ArraySegment<Byte> | info | An ArraySegment<T> that contains the context and application-specific information. Can be empty ArraySegment<T>. This is the 'info' argument from RFC 5869. |
Exceptions
Type | Condition |
---|---|
ArgumentException | The |