Redigera

Dela via


SP800108HmacCounterKdf.DeriveKey Method

Definition

Overloads

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

Derives a key of a specified length.

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

Derives a key of a specified length.

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

Fills a buffer with a derived key.

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

Derives a key of a specified length.

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

Fills a buffer with a derived key.

DeriveKey(String, String, Int32)

Derives a key of a specified length.

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Derives a key of a specified length.

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

Parameters

label
Byte[]

The label that identifies the purpose for the derived key.

context
Byte[]

The context containing information related to the derived key.

derivedKeyLengthInBytes
Int32

The length of the derived key, in bytes.

Returns

Byte[]

An array containing the derived key.

Exceptions

label is null.

-or-

context is null.

derivedKeyLengthInBytes is negative or larger than the maximum number of bytes that can be derived.

Applies to

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Derives a key of a specified length.

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

Parameters

label
ReadOnlySpan<Byte>

The label that identifies the purpose for the derived key.

context
ReadOnlySpan<Byte>

The context containing information related to the derived key.

derivedKeyLengthInBytes
Int32

The length of the derived key, in bytes.

Returns

Byte[]

An array containing the derived key.

Exceptions

derivedKeyLengthInBytes is negative or larger than the maximum number of bytes that can be derived.

Applies to

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Fills a buffer with a derived key.

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

Parameters

label
ReadOnlySpan<Byte>

The label that identifies the purpose for the derived key.

context
ReadOnlySpan<Byte>

The context containing information related to the derived key.

destination
Span<Byte>

The buffer which will receive the derived key.

Exceptions

label is null.

-or-

context is null.

destination is larger than the maximum number of bytes that can be derived.

Applies to

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Derives a key of a specified length.

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

Parameters

label
ReadOnlySpan<Char>

The label that identifies the purpose for the derived key.

context
ReadOnlySpan<Char>

The context containing information related to the derived key.

derivedKeyLengthInBytes
Int32

The length of the derived key, in bytes.

Returns

Byte[]

An array containing the derived key.

Exceptions

derivedKeyLengthInBytes is negative or larger than the maximum number of bytes that can be derived.

label or context contains text that cannot be converted to UTF-8.

Remarks

label and context will be converted to bytes using the UTF-8 encoding. for other encodings, perform the conversion using the desired encoding and use an overload which accepts the label and context as a sequence of bytes.

Applies to

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Fills a buffer with a derived key.

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

Parameters

label
ReadOnlySpan<Char>

The label that identifies the purpose for the derived key.

context
ReadOnlySpan<Char>

The context containing information related to the derived key.

destination
Span<Byte>

The buffer which will receive the derived key.

Exceptions

destination is larger than the maximum number of bytes that can be derived.

label or context contains text that cannot be converted to UTF-8.

Remarks

label and context will be converted to bytes using the UTF-8 encoding. for other encodings, perform the conversion using the desired encoding and use an overload which accepts the label and context as a sequence of bytes.

Applies to

DeriveKey(String, String, Int32)

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Derives a key of a specified length.

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

Parameters

label
String

The label that identifies the purpose for the derived key.

context
String

The context containing information related to the derived key.

derivedKeyLengthInBytes
Int32

The length of the derived key, in bytes.

Returns

Byte[]

An array containing the derived key.

Exceptions

label is null.

-or-

context is null.

derivedKeyLengthInBytes is negative or larger than the maximum number of bytes that can be derived.

label or context contains text that cannot be converted to UTF-8.

Remarks

label and context will be converted to bytes using the UTF-8 encoding. for other encodings, perform the conversion using the desired encoding and use an overload which accepts the label and context as a sequence of bytes.

Applies to