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 byte[] DeriveKey (byte[] label, byte[] context, int derivedKeyLengthInBytes);

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

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Derives a key of a specified length.

public byte[] DeriveKey (ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, int derivedKeyLengthInBytes);

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

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Fills a buffer with a derived key.

public void DeriveKey (ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination);

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

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Derives a key of a specified length.

public byte[] DeriveKey (ReadOnlySpan<char> label, ReadOnlySpan<char> context, int derivedKeyLengthInBytes);

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

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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<byte> destination);

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

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeriveKey(String, String, Int32)

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

Derives a key of a specified length.

public byte[] DeriveKey (string label, string context, int derivedKeyLengthInBytes);

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

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)