SP800108HmacCounterKdf.DeriveBytes 方法

定义

重载

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

派生指定长度的键。

DeriveBytes(Byte[], HashAlgorithmName, String, String, Int32)

派生指定长度的键。

DeriveBytes(ReadOnlySpan<Byte>, HashAlgorithmName, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

派生指定长度的键。

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

使用派生键填充缓冲区。

DeriveBytes(ReadOnlySpan<Byte>, HashAlgorithmName, ReadOnlySpan<Char>, ReadOnlySpan<Char>, Int32)

派生指定长度的键。

DeriveBytes(ReadOnlySpan<Byte>, HashAlgorithmName, ReadOnlySpan<Char>, ReadOnlySpan<Char>, Span<Byte>)

使用派生键填充缓冲区。

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

派生指定长度的键。

public:
 static cli::array <System::Byte> ^ DeriveBytes(cli::array <System::Byte> ^ key, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, cli::array <System::Byte> ^ label, cli::array <System::Byte> ^ context, int derivedKeyLengthInBytes);
public static byte[] DeriveBytes (byte[] key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] label, byte[] context, int derivedKeyLengthInBytes);
static member DeriveBytes : byte[] * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] * int -> byte[]
Public Shared Function DeriveBytes (key As Byte(), hashAlgorithm As HashAlgorithmName, label As Byte(), context As Byte(), derivedKeyLengthInBytes As Integer) As Byte()

参数

key
Byte[]

密钥派生键。

hashAlgorithm
HashAlgorithmName

HMAC 算法。

label
Byte[]

标识派生密钥用途的标签。

context
Byte[]

包含与派生密钥相关的信息的上下文。

derivedKeyLengthInBytes
Int32

派生密钥的长度(以字节为单位)。

返回

Byte[]

包含派生键的数组。

例外

keynull

labelnull

contextnull

hashAlgorithm 具有一个 Name ,它为 null

hashAlgorithm 具有一个 Name 为空的 。

derivedKeyLengthInBytes 为负数或大于可派生的最大字节数。

hashAlgorithm 不是已知或支持的哈希算法。

当前平台不支持 HMAC 实现。

适用于

DeriveBytes(Byte[], HashAlgorithmName, String, String, Int32)

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

派生指定长度的键。

public:
 static cli::array <System::Byte> ^ DeriveBytes(cli::array <System::Byte> ^ key, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::String ^ label, System::String ^ context, int derivedKeyLengthInBytes);
public static byte[] DeriveBytes (byte[] key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, string label, string context, int derivedKeyLengthInBytes);
static member DeriveBytes : byte[] * System.Security.Cryptography.HashAlgorithmName * string * string * int -> byte[]
Public Shared Function DeriveBytes (key As Byte(), hashAlgorithm As HashAlgorithmName, label As String, context As String, derivedKeyLengthInBytes As Integer) As Byte()

参数

key
Byte[]

密钥派生键。

hashAlgorithm
HashAlgorithmName

HMAC 算法。

label
String

标识派生密钥用途的标签。

context
String

包含与派生密钥相关的信息的上下文。

derivedKeyLengthInBytes
Int32

派生密钥的长度(以字节为单位)。

返回

Byte[]

包含派生键的数组。

例外

keynull

labelnull

contextnull

hashAlgorithm 具有一个 Name ,它为 null

hashAlgorithm 具有一个 Name 为空的 。

derivedKeyLengthInBytes 为负数或大于可派生的最大字节数。

hashAlgorithm 不是已知或支持的哈希算法。

labelcontext 包含无法转换为 UTF-8 的文本。

当前平台不支持 HMAC 实现。

注解

labelcontext 将使用 UTF-8 编码转换为字节。 对于其他编码,请使用所需的编码执行转换,并使用接受标签和上下文作为字节序列的重载。

适用于

DeriveBytes(ReadOnlySpan<Byte>, HashAlgorithmName, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

派生指定长度的键。

public:
 static cli::array <System::Byte> ^ DeriveBytes(ReadOnlySpan<System::Byte> key, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> label, ReadOnlySpan<System::Byte> context, int derivedKeyLengthInBytes);
public static byte[] DeriveBytes (ReadOnlySpan<byte> key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, int derivedKeyLengthInBytes);
static member DeriveBytes : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> * ReadOnlySpan<byte> * int -> byte[]
Public Shared Function DeriveBytes (key As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, label As ReadOnlySpan(Of Byte), context As ReadOnlySpan(Of Byte), derivedKeyLengthInBytes As Integer) As Byte()

参数

key
ReadOnlySpan<Byte>

密钥派生键。

hashAlgorithm
HashAlgorithmName

HMAC 算法。

label
ReadOnlySpan<Byte>

标识派生密钥用途的标签。

context
ReadOnlySpan<Byte>

包含与派生密钥相关的信息的上下文。

derivedKeyLengthInBytes
Int32

派生密钥的长度(以字节为单位)。

返回

Byte[]

包含派生键的数组。

例外

hashAlgorithm 具有一个 Name ,它为 null

hashAlgorithm 具有一个 Name 为空的 。

derivedKeyLengthInBytes 为负数或大于可派生的最大字节数。

hashAlgorithm 不是已知或支持的哈希算法。

当前平台不支持 HMAC 实现。

适用于

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

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

使用派生键填充缓冲区。

public:
 static void DeriveBytes(ReadOnlySpan<System::Byte> key, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> label, ReadOnlySpan<System::Byte> context, Span<System::Byte> destination);
public static void DeriveBytes (ReadOnlySpan<byte> key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination);
static member DeriveBytes : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> -> unit
Public Shared Sub DeriveBytes (key As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, label As ReadOnlySpan(Of Byte), context As ReadOnlySpan(Of Byte), destination As Span(Of Byte))

参数

key
ReadOnlySpan<Byte>

密钥派生键。

hashAlgorithm
HashAlgorithmName

HMAC 算法。

label
ReadOnlySpan<Byte>

标识派生密钥用途的标签。

context
ReadOnlySpan<Byte>

包含与派生密钥相关的信息的上下文。

destination
Span<Byte>

将接收派生密钥的缓冲区。

例外

hashAlgorithm 具有一个 Name ,它为 null

hashAlgorithm 具有一个 Name 为空的 。

destination 大于可派生的最大字节数。

hashAlgorithm 不是已知或支持的哈希算法。

当前平台不支持 HMAC 实现。

适用于

DeriveBytes(ReadOnlySpan<Byte>, HashAlgorithmName, ReadOnlySpan<Char>, ReadOnlySpan<Char>, Int32)

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

派生指定长度的键。

public:
 static cli::array <System::Byte> ^ DeriveBytes(ReadOnlySpan<System::Byte> key, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, int derivedKeyLengthInBytes);
public static byte[] DeriveBytes (ReadOnlySpan<byte> key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, int derivedKeyLengthInBytes);
static member DeriveBytes : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<char> * ReadOnlySpan<char> * int -> byte[]
Public Shared Function DeriveBytes (key As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, label As ReadOnlySpan(Of Char), context As ReadOnlySpan(Of Char), derivedKeyLengthInBytes As Integer) As Byte()

参数

key
ReadOnlySpan<Byte>

密钥派生键。

hashAlgorithm
HashAlgorithmName

HMAC 算法。

label
ReadOnlySpan<Char>

标识派生密钥用途的标签。

context
ReadOnlySpan<Char>

包含与派生密钥相关的信息的上下文。

derivedKeyLengthInBytes
Int32

派生密钥的长度(以字节为单位)。

返回

Byte[]

包含派生键的数组。

例外

hashAlgorithm 具有一个 Name ,它为 null

hashAlgorithm 具有一个 Name 为空的 。

derivedKeyLengthInBytes 为负数或大于可派生的最大字节数。

hashAlgorithm 不是已知或支持的哈希算法。

labelcontext 包含无法转换为 UTF-8 的文本。

当前平台不支持 HMAC 实现。

注解

labelcontext 将使用 UTF-8 编码转换为字节。 对于其他编码,请使用所需的编码执行转换,并使用接受标签和上下文作为字节序列的重载。

适用于

DeriveBytes(ReadOnlySpan<Byte>, HashAlgorithmName, ReadOnlySpan<Char>, ReadOnlySpan<Char>, Span<Byte>)

Source:
SP800108HmacCounterKdf.cs
Source:
SP800108HmacCounterKdf.cs

使用派生密钥填充缓冲区。

public:
 static void DeriveBytes(ReadOnlySpan<System::Byte> key, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<System::Byte> destination);
public static void DeriveBytes (ReadOnlySpan<byte> key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination);
static member DeriveBytes : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<char> * ReadOnlySpan<char> * Span<byte> -> unit
Public Shared Sub DeriveBytes (key As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, label As ReadOnlySpan(Of Char), context As ReadOnlySpan(Of Char), destination As Span(Of Byte))

参数

key
ReadOnlySpan<Byte>

密钥派生键。

hashAlgorithm
HashAlgorithmName

HMAC 算法。

label
ReadOnlySpan<Char>

标识派生密钥用途的标签。

context
ReadOnlySpan<Char>

包含与派生密钥相关的信息的上下文。

destination
Span<Byte>

将接收派生密钥的缓冲区。

例外

hashAlgorithm 具有一个 Name ,它为 null

hashAlgorithm 具有一个 Name 为空的 。

destination 大于可派生的最大字节数。

hashAlgorithm 不是已知或支持的哈希算法。

labelcontext 包含无法转换为 UTF-8 的文本。

当前平台不支持 HMAC 实现。

注解

labelcontext 将使用 UTF-8 编码转换为字节。 对于其他编码,请使用所需的编码执行转换,并使用接受标签和上下文作为字节序列的重载。

适用于