語言

HKDF.DeriveKey 方法

定義

執行關鍵推導 HKDF 擴展與萃取函數。

多載

名稱 Description
DeriveKey(HashAlgorithmName, Byte[], Int32, Byte[], Byte[])

執行關鍵推導 HKDF 擴展與萃取函數。

DeriveKey(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

執行關鍵推導 HKDF 擴展與萃取函數。

DeriveKey(HashAlgorithmName, Byte[], Int32, Byte[], Byte[])

來源:
HKDF.cs
來源:
HKDF.cs
來源:
HKDF.cs
來源:
HKDF.cs
來源:
HKDF.cs

執行關鍵推導 HKDF 擴展與萃取函數。

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()

參數

hashAlgorithmName
HashAlgorithmName

用於 HMAC 操作的雜湊演算法。

ikm
Byte[]

輸入鍵控材料。

outputLength
Int32

輸出鍵控材料的長度。

salt
Byte[]

可選的鹽值(非秘密隨機值)。 若未提供,則預設為與指定雜湊演算法輸出相同長度的位元組陣列。

info
Byte[]

可選的情境與應用專屬資訊。

傳回

Byte[]

輸出鍵控材料。

例外狀況

ikm是 null。

outputLength 小於1。

適用於

DeriveKey(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

來源:
HKDF.cs
來源:
HKDF.cs
來源:
HKDF.cs
來源:
HKDF.cs
來源:
HKDF.cs

執行關鍵推導 HKDF 擴展與萃取函數。

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))

參數

hashAlgorithmName
HashAlgorithmName

用於 HMAC 操作的雜湊演算法。

ikm
ReadOnlySpan<Byte>

輸入鍵控材料。

output
Span<Byte>

代表輸出鍵控材料的輸出緩衝區。

salt
ReadOnlySpan<Byte>

鹽值(非秘密隨機值)。

info
ReadOnlySpan<Byte>

上下文與應用程式專屬資訊(可以是空白區間)。

例外狀況

output 為空,或大於最大允許長度。

適用於