SP800108HmacCounterKdf.DeriveKey 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
用衍生金鑰填充緩衝區。
多載
| 名稱 | 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)
推導出指定長度的金鑰。
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
導出金鑰的長度,以位元組為單位。
傳回
一個包含導出金鑰的陣列。
例外狀況
derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。
適用於
DeriveKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)
推導出指定長度的金鑰。
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
導出金鑰的長度,以位元組為單位。
傳回
一個包含導出金鑰的陣列。
例外狀況
derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。
適用於
DeriveKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>)
用衍生金鑰填充緩衝區。
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 大於可推導的最大位元組數。
適用於
DeriveKey(ReadOnlySpan<Char>, ReadOnlySpan<Char>, Int32)
推導出指定長度的金鑰。
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
導出金鑰的長度,以位元組為單位。
傳回
一個包含導出金鑰的陣列。
例外狀況
derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。
label 或 context 包含無法轉換為 UTF-8 的文字。
備註
label 並 context 會使用 UTF-8 編碼轉換成位元組。 對於其他編碼,則使用所需的編碼進行轉換,並使用一個過載,將標籤與上下文視為一串位元組。
適用於
DeriveKey(ReadOnlySpan<Char>, ReadOnlySpan<Char>, Span<Byte>)
用衍生金鑰填充緩衝區。
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 大於可推導的最大位元組數。
label 或 context 包含無法轉換為 UTF-8 的文字。
備註
label 並 context 會使用 UTF-8 編碼轉換成位元組。 對於其他編碼,則使用所需的編碼進行轉換,並使用一個過載,將標籤與上下文視為一串位元組。
適用於
DeriveKey(String, String, Int32)
推導出指定長度的金鑰。
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
導出金鑰的長度,以位元組為單位。
傳回
一個包含導出金鑰的陣列。
例外狀況
derivedKeyLengthInBytes 為負值或大於可推導的最大位元組數。
label 或 context 包含無法轉換為 UTF-8 的文字。
備註
label 並 context 會使用 UTF-8 編碼轉換成位元組。 對於其他編碼,則使用所需的編碼進行轉換,並使用一個過載,將標籤與上下文視為一串位元組。