HKDF.Expand Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Expand(HashAlgorithmName, Byte[], Int32, Byte[]) |
Performs the HKDF-Expand function See section 2.3 of RFC5869. |
Expand(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>) |
Performs the HKDF-Expand function. See section 2.3 of RFC5869. |
Expand(HashAlgorithmName, Byte[], Int32, Byte[])
- Source:
- HKDF.cs
- Source:
- HKDF.cs
- Source:
- HKDF.cs
Performs the HKDF-Expand function See section 2.3 of RFC5869.
public static byte[] Expand (System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] prk, int outputLength, byte[]? info = default);
static member Expand : System.Security.Cryptography.HashAlgorithmName * byte[] * int * byte[] -> byte[]
Public Shared Function Expand (hashAlgorithmName As HashAlgorithmName, prk As Byte(), outputLength As Integer, Optional info As Byte() = Nothing) As Byte()
Parameters
- hashAlgorithmName
- HashAlgorithmName
The hash algorithm used for HMAC operations.
- prk
- Byte[]
The pseudorandom key that is at least as long as the output byte array of the specified hash algorithm (usually the output from the Extract step).
- outputLength
- Int32
The length of the output keying material.
- info
- Byte[]
The optional context and application specific information.
Returns
The output keying material.
Exceptions
prk
is null
.
outputLength
is less than 1.
Applies to
Expand(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)
- Source:
- HKDF.cs
- Source:
- HKDF.cs
- Source:
- HKDF.cs
Performs the HKDF-Expand function. See section 2.3 of RFC5869.
public:
static void Expand(System::Security::Cryptography::HashAlgorithmName hashAlgorithmName, ReadOnlySpan<System::Byte> prk, Span<System::Byte> output, ReadOnlySpan<System::Byte> info);
public static void Expand (System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> prk, Span<byte> output, ReadOnlySpan<byte> info);
static member Expand : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> -> unit
Public Shared Sub Expand (hashAlgorithmName As HashAlgorithmName, prk As ReadOnlySpan(Of Byte), output As Span(Of Byte), info As ReadOnlySpan(Of Byte))
Parameters
- hashAlgorithmName
- HashAlgorithmName
The hash algorithm used for HMAC operations.
- prk
- ReadOnlySpan<Byte>
The pseudorandom key that is at least as long as as the output byte array of the specified hash algorithm (usually the output from the Extract step).
- info
- ReadOnlySpan<Byte>
The context and application specific information (can be an empty span).
Exceptions
output
is empty, or is larger than the maximum allowed length.