DSA.SignData 方法

定义

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

重载

SignData(Byte[], HashAlgorithmName)

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

SignData(Stream, HashAlgorithmName)

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

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

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

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

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

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

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

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

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

SignData(Byte[], HashAlgorithmName)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

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

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

参数

data
Byte[]

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

hashAlgorithm
HashAlgorithmName

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

返回

Byte[]

指定数据的 DSA 签名。

例外

data 上声明的默认值为 null

hashAlgorithm.NamenullEmpty

适用于

SignData(Stream, HashAlgorithmName)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.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[]

指定数据的 DSA 签名。

例外

data 上声明的默认值为 null

hashAlgorithm.NamenullEmpty

适用于

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.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[]

指定数据的 DSA 签名。

例外

data 上声明的默认值为 null

signatureFormat 不是已知格式。

hashAlgorithm 具有 null 或空的 Name

哈希处理或签名时出错。

适用于

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.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[]

指定数据的 DSA 签名。

例外

data 上声明的默认值为 null

signatureFormat 不是已知格式。

hashAlgorithm 具有 null 或空的 Name

哈希处理或签名时出错。

适用于

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

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.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[]

指定数据的 DSA 签名。

例外

data 上声明的默认值为 null

hashAlgorithm.NamenullEmpty

offset 小于零。

count 小于零。

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

适用于

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

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.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[]

指定数据的 DSA 签名。

例外

data 上声明的默认值为 null

signatureFormat 不是已知格式。

- 或 - offset 小于零。

- 或 - count 小于零。

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

hashAlgorithm 具有 null 或空的 Name

哈希处理或签名时出错。

适用于