HKDF.Extract Method
Namespace: Rebex.Security.Cryptography
Assembly: Rebex.Security.dll (version 7.0.9083)
Extract(HashingAlgorithmId, Byte[], Byte[])
HKDF Extract function according to section 2.2 of RFC 5869.
Declaration
public static byte[] Extract(HashingAlgorithmId hashingAlgorithmId, byte[] ikm, byte[] salt = null)
Parameters
Type | Name | Description |
---|---|---|
HashingAlgorithmId | hashingAlgorithmId | The hash algorithm for HMAC operations. |
Byte[] | ikm | A byte array that contains input keying material. This is the 'IKM' parameter from RFC 5869. |
Byte[] | salt | A byte array that contains the salt. When null or empty salt is specified,
this method will use a zero-filled salt with size equal to the hash size of |
Returns
Type | Description |
---|---|
Byte[] | A byte array that contains the pseudorandom key (the 'PRK' output from RFC 5869). |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentException | The |
Extract(HashingAlgorithmId, ArraySegment<Byte>, ArraySegment<Byte>, ArraySegment<Byte>)
HKDF Extract function according to section 2.2 of RFC 5869.
Declaration
public static int Extract(HashingAlgorithmId hashingAlgorithmId, ArraySegment<byte> ikm, ArraySegment<byte> salt, ArraySegment<byte> prk)
Parameters
Type | Name | Description |
---|---|---|
HashingAlgorithmId | hashingAlgorithmId | The hash algorithm for HMAC operations. |
ArraySegment<Byte> | ikm | An ArraySegment<T> that contains input keying material. This is the 'IKM' parameter from RFC 5869. |
ArraySegment<Byte> | salt | An ArraySegment<T> that contains the salt. When an empty salt is specified,
this method will use a zero-filled salt with size equal to the hash size of |
ArraySegment<Byte> | prk | An ArraySegment<T> that will receive the pseudorandom key (the 'PRK' output from RFC 5869).
The length of |
Returns
Type | Description |
---|---|
Int32 | The number of bytes written to |
Exceptions
Type | Condition |
---|---|
ArgumentException | The |