HKDF.DeriveKey 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
DeriveKey(HashAlgorithmName, Byte[], Int32, Byte[], Byte[]) |
Performs the key derivation HKDF Expand and Extract functions. |
DeriveKey(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
Performs the key derivation HKDF Expand and Extract functions. |
DeriveKey(HashAlgorithmName, Byte[], Int32, Byte[], Byte[])
- Source:
- HKDF.cs
- Source:
- HKDF.cs
- Source:
- HKDF.cs
Performs the key derivation HKDF Expand and Extract functions.
public static byte[] DeriveKey (System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] ikm, int outputLength, byte[]? salt = default, byte[]? info = default);
static member DeriveKey : System.Security.Cryptography.HashAlgorithmName * byte[] * int * byte[] * byte[] -> byte[]
Public Shared Function DeriveKey (hashAlgorithmName As HashAlgorithmName, ikm As Byte(), outputLength As Integer, Optional salt As Byte() = Nothing, Optional info As Byte() = Nothing) As Byte()
Parameters
- hashAlgorithmName
- HashAlgorithmName
The hash algorithm used for HMAC operations.
- ikm
- Byte[]
The input keying material.
- outputLength
- Int32
The length of the output keying material.
- salt
- Byte[]
The optional salt value (a non-secret random value). If not provided, it defaults to a byte array of the same length as the output of the specified hash algorithm.
- info
- Byte[]
The optional context and application specific information.
Returns
The output keying material.
Exceptions
ikm
is null
.
outputLength
is less than 1.
Applies to
DeriveKey(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
- Source:
- HKDF.cs
- Source:
- HKDF.cs
- Source:
- HKDF.cs
Performs the key derivation HKDF Expand and Extract functions.
public:
static void DeriveKey(System::Security::Cryptography::HashAlgorithmName hashAlgorithmName, ReadOnlySpan<System::Byte> ikm, Span<System::Byte> output, ReadOnlySpan<System::Byte> salt, ReadOnlySpan<System::Byte> info);
public static void DeriveKey (System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, Span<byte> output, ReadOnlySpan<byte> salt, ReadOnlySpan<byte> info);
static member DeriveKey : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> * ReadOnlySpan<byte> -> unit
Public Shared Sub DeriveKey (hashAlgorithmName As HashAlgorithmName, ikm As ReadOnlySpan(Of Byte), output As Span(Of Byte), salt As ReadOnlySpan(Of Byte), info As ReadOnlySpan(Of Byte))
Parameters
- hashAlgorithmName
- HashAlgorithmName
The hash algorithm used for HMAC operations.
- ikm
- ReadOnlySpan<Byte>
The input keying material.
- salt
- ReadOnlySpan<Byte>
The salt value (a non-secret random value).
- info
- ReadOnlySpan<Byte>
The context and application specific information (can be an empty span).
Exceptions
ikm
is empty, or is larger than the maximum allowed length.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기