ECDsa.SignData 方法

定义

计算指定数据的哈希值并对其进行签名。

重载

名称 说明
SignData(Byte[], HashAlgorithmName)

使用指定的哈希算法计算指定字节数组的哈希值,并对生成的哈希值进行签名。

SignData(Stream, HashAlgorithmName)

使用指定的哈希算法计算指定流的哈希值,并对生成的哈希值进行签名。

SignData(ReadOnlySpan<Byte>, HashAlgorithmName)

计算指定数据的哈希值并对其进行签名。

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

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

计算指定数据的哈希值,并将其以指示格式签名到提供的缓冲区中。

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

使用指定的哈希算法计算指定字节数组的一部分的哈希值,并对生成的哈希值进行签名。

SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并将其以指示格式签名到提供的缓冲区中。

SignData(Byte[], Int32, Int32, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

SignData(Byte[], HashAlgorithmName)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

使用指定的哈希算法计算指定字节数组的哈希值,并对生成的哈希值进行签名。

public:
 virtual cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member SignData : byte[] * System.Security.Cryptography.HashAlgorithmName -> byte[]
override this.SignData : byte[] * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Overridable Function SignData (data As Byte(), hashAlgorithm As HashAlgorithmName) As Byte()

参数

data
Byte[]

要计算其哈希的输入数据。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

datanull

hashAlgorithmNamenullEmpty

适用于

SignData(Stream, HashAlgorithmName)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

使用指定的哈希算法计算指定流的哈希值,并对生成的哈希值进行签名。

public:
 virtual cli::array <System::Byte> ^ SignData(System::IO::Stream ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member SignData : System.IO.Stream * System.Security.Cryptography.HashAlgorithmName -> byte[]
override this.SignData : System.IO.Stream * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Overridable Function SignData (data As Stream, hashAlgorithm As HashAlgorithmName) As Byte()

参数

data
Stream

要计算其哈希的输入流。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

datanull

hashAlgorithmNamenullEmpty

适用于

SignData(ReadOnlySpan<Byte>, HashAlgorithmName)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定数据的哈希值并对其进行签名。

public:
 cli::array <System::Byte> ^ SignData(ReadOnlySpan<System::Byte> data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public byte[] SignData(ReadOnlySpan<byte> data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
member this.SignData : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Function SignData (data As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName) As Byte()

参数

data
ReadOnlySpan<Byte>

要进行哈希和签名的数据。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

hashAlgorithm's Name 是空字符串。

hashAlgorithm's Namenull

注解

此方法将用于 IeeeP1363FixedFieldConcatenation 对签名进行编码。 若要使用不同的签名格式,请使用 SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

另请参阅

适用于

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

public:
 cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignData (data As Byte(), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Byte()

参数

data
Byte[]

要签名的数据。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

signatureFormat
DSASignatureFormat

用于签名的编码格式。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

datanull

signatureFormat 不是已知格式。

hashAlgorithm 具有或 null 为空 Name

哈希或签名操作中出错。

适用于

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

public:
 cli::array <System::Byte> ^ SignData(System::IO::Stream ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : System.IO.Stream * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignData (data As Stream, hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Byte()

参数

data
Stream

要签名的数据。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

signatureFormat
DSASignatureFormat

用于签名的编码格式。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

datanull

signatureFormat 不是已知格式。

hashAlgorithm 具有或 null 为空 Name

哈希或签名操作中出错。

适用于

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

public:
 cli::array <System::Byte> ^ SignData(ReadOnlySpan<System::Byte> data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignData(ReadOnlySpan<byte> data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignData (data As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Byte()

参数

data
ReadOnlySpan<Byte>

要进行哈希和签名的数据。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

signatureFormat
DSASignatureFormat

用于签名的编码格式。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

hashAlgorithm's Name 是空字符串。

hashAlgorithm's Namenull

signatureFormat 不是已知格式。

另请参阅

适用于

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

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定数据的哈希值,并将其以指示格式签名到提供的缓冲区中。

public:
 int SignData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
member this.SignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName -> int
Public Function SignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName) As Integer

参数

data
ReadOnlySpan<Byte>

要进行哈希和签名的数据。

destination
Span<Byte>

要接收签名的缓冲区。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

返回

写入到 destination的字节总数。

例外

hashAlgorithm's Name 是空字符串。

-或-

缓冲区 destination 太小,无法保存签名。

hashAlgorithm's Namenull

注解

此方法将用于 IeeeP1363FixedFieldConcatenation 对签名进行编码。 若要使用不同的签名格式,请使用 SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat)

另请参阅

适用于

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

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

使用指定的哈希算法计算指定字节数组的一部分的哈希值,并对生成的哈希值进行签名。

public:
 virtual cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data, int offset, int count, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member SignData : byte[] * int * int * System.Security.Cryptography.HashAlgorithmName -> byte[]
override this.SignData : byte[] * int * int * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Overridable Function SignData (data As Byte(), offset As Integer, count As Integer, hashAlgorithm As HashAlgorithmName) As Byte()

参数

data
Byte[]

要计算其哈希的输入数据。

offset
Int32

开始使用数据的数组中的偏移量。

count
Int32

要用作数据的数组中的字节数。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

datanull

hashAlgorithmNamenullEmpty

offset 小于零。

-或-

count 小于零。

-或-

offset + count - 1 导致超出上限的 data索引。

适用于

SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定数据的哈希值,并将其以指示格式签名到提供的缓冲区中。

public:
 int SignData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> int
Public Function SignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Integer

参数

data
ReadOnlySpan<Byte>

要进行哈希和签名的数据。

destination
Span<Byte>

要接收签名的缓冲区。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

signatureFormat
DSASignatureFormat

用于签名的编码格式。

返回

写入到 destination的字节总数。

例外

hashAlgorithm's Name 是空字符串。

-或-

缓冲区 destination 太小,无法保存签名。

hashAlgorithm's Namenull

signatureFormat 不是已知格式。

另请参阅

适用于

SignData(Byte[], Int32, Int32, HashAlgorithmName, DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

public:
 cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data, int offset, int count, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : byte[] * int * int * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignData (data As Byte(), offset As Integer, count As Integer, hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Byte()

参数

data
Byte[]

要签名的数据。

offset
Int32

开始哈希的偏移量 data

count
Int32

要从 data中读取的字节数。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

signatureFormat
DSASignatureFormat

用于签名的编码格式。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

datanull

signatureFormat 不是已知格式。

-或-

offset 小于零。

-或-

count 小于零。

-或-

offset + count - 1 导致超出上限的 data索引。

hashAlgorithm 具有或 null 为空 Name

哈希或签名操作中出错。

适用于