語言

SP800108HmacCounterKdf.DeriveKey 方法

定義

用衍生金鑰填充緩衝區。

多載

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

推導出指定長度的金鑰。

DeriveKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

推導出指定長度的金鑰。

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

用衍生金鑰填充緩衝區。

DeriveKey(ReadOnlySpan<Char>, ReadOnlySpan<Char>, Int32)

推導出指定長度的金鑰。

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

用衍生金鑰填充緩衝區。

DeriveKey(String, String, Int32)

推導出指定長度的金鑰。

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

來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs

推導出指定長度的金鑰。

public:
 cli::array <System::Byte> ^ DeriveKey(cli::array <System::Byte> ^ label, cli::array <System::Byte> ^ context, int derivedKeyLengthInBytes);
public byte[] DeriveKey(byte[] label, byte[] context, int derivedKeyLengthInBytes);
member this.DeriveKey : byte[] * byte[] * int -> byte[]
Public Function DeriveKey (label As Byte(), context As Byte(), derivedKeyLengthInBytes As Integer) As Byte()

參數

label
Byte[]

標示導出金鑰目的的標籤。

context
Byte[]

包含與導出金鑰相關資訊的上下文。

derivedKeyLengthInBytes
Int32

導出金鑰的長度,以位元組為單位。

傳回

Byte[]

一個包含導出金鑰的陣列。

例外狀況

label 是 null。

-或-

context 是 null。

derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。

適用於

DeriveKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs

推導出指定長度的金鑰。

public:
 cli::array <System::Byte> ^ DeriveKey(ReadOnlySpan<System::Byte> label, ReadOnlySpan<System::Byte> context, int derivedKeyLengthInBytes);
public byte[] DeriveKey(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, int derivedKeyLengthInBytes);
member this.DeriveKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> * int -> byte[]
Public Function DeriveKey (label As ReadOnlySpan(Of Byte), context As ReadOnlySpan(Of Byte), derivedKeyLengthInBytes As Integer) As Byte()

參數

label
ReadOnlySpan<Byte>

標示導出金鑰目的的標籤。

context
ReadOnlySpan<Byte>

包含與導出金鑰相關資訊的上下文。

derivedKeyLengthInBytes
Int32

導出金鑰的長度,以位元組為單位。

傳回

Byte[]

一個包含導出金鑰的陣列。

例外狀況

derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。

適用於

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

來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs

用衍生金鑰填充緩衝區。

public:
 void DeriveKey(ReadOnlySpan<System::Byte> label, ReadOnlySpan<System::Byte> context, Span<System::Byte> destination);
public void DeriveKey(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination);
member this.DeriveKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> -> unit
Public Sub DeriveKey (label As ReadOnlySpan(Of Byte), context As ReadOnlySpan(Of Byte), destination As Span(Of Byte))

參數

label
ReadOnlySpan<Byte>

標示導出金鑰目的的標籤。

context
ReadOnlySpan<Byte>

包含與導出金鑰相關資訊的上下文。

destination
Span<Byte>

將接收導出金鑰的緩衝區。

例外狀況

label 是 null。

-或-

context 是 null。

destination 大於可推導的最大位元組數。

適用於

DeriveKey(ReadOnlySpan<Char>, ReadOnlySpan<Char>, Int32)

來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs

推導出指定長度的金鑰。

public:
 cli::array <System::Byte> ^ DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, int derivedKeyLengthInBytes);
public byte[] DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, int derivedKeyLengthInBytes);
member this.DeriveKey : ReadOnlySpan<char> * ReadOnlySpan<char> * int -> byte[]
Public Function DeriveKey (label As ReadOnlySpan(Of Char), context As ReadOnlySpan(Of Char), derivedKeyLengthInBytes As Integer) As Byte()

參數

label
ReadOnlySpan<Char>

標示導出金鑰目的的標籤。

context
ReadOnlySpan<Char>

包含與導出金鑰相關資訊的上下文。

derivedKeyLengthInBytes
Int32

導出金鑰的長度,以位元組為單位。

傳回

Byte[]

一個包含導出金鑰的陣列。

例外狀況

derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。

label 或 context 包含無法轉換為 UTF-8 的文字。

備註

label 並 context 會使用 UTF-8 編碼轉換成位元組。 對於其他編碼,則使用所需的編碼進行轉換,並使用一個過載,將標籤與上下文視為一串位元組。

適用於

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

來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs

用衍生金鑰填充緩衝區。

public:
 void DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<System::Byte> destination);
public void DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination);
member this.DeriveKey : ReadOnlySpan<char> * ReadOnlySpan<char> * Span<byte> -> unit
Public Sub DeriveKey (label As ReadOnlySpan(Of Char), context As ReadOnlySpan(Of Char), destination As Span(Of Byte))

參數

label
ReadOnlySpan<Char>

標示導出金鑰目的的標籤。

context
ReadOnlySpan<Char>

包含與導出金鑰相關資訊的上下文。

destination
Span<Byte>

將接收導出金鑰的緩衝區。

例外狀況

destination 大於可推導的最大位元組數。

label 或 context 包含無法轉換為 UTF-8 的文字。

備註

label 並 context 會使用 UTF-8 編碼轉換成位元組。 對於其他編碼,則使用所需的編碼進行轉換,並使用一個過載,將標籤與上下文視為一串位元組。

適用於

DeriveKey(String, String, Int32)

來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs
來源:
SP800108HmacCounterKdf.cs

推導出指定長度的金鑰。

public:
 cli::array <System::Byte> ^ DeriveKey(System::String ^ label, System::String ^ context, int derivedKeyLengthInBytes);
public byte[] DeriveKey(string label, string context, int derivedKeyLengthInBytes);
member this.DeriveKey : string * string * int -> byte[]
Public Function DeriveKey (label As String, context As String, derivedKeyLengthInBytes As Integer) As Byte()

參數

label
String

標示導出金鑰目的的標籤。

context
String

包含與導出金鑰相關資訊的上下文。

derivedKeyLengthInBytes
Int32

導出金鑰的長度,以位元組為單位。

傳回

Byte[]

一個包含導出金鑰的陣列。

例外狀況

label 是 null。

-或-

context 是 null。

derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。

label 或 context 包含無法轉換為 UTF-8 的文字。

備註

label 並 context 會使用 UTF-8 編碼轉換成位元組。 對於其他編碼,則使用所需的編碼進行轉換,並使用一個過載,將標籤與上下文視為一串位元組。

適用於