DSA.SignData 方法

定义

计算指定数据的哈希值,并对其进行签名。Computes the hash value of the specified data and signs it.

重载

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

使用指定的哈希算法计算指定字节数组的一个部分的哈希值,并对生成的哈希值进行签名。Computes the hash value of a portion of the specified byte array using the specified hash algorithm and signs the resulting hash value.

SignData(Byte[], HashAlgorithmName)

使用指定的哈希算法计算指定字节数组的哈希值,并对生成的哈希值进行签名。Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value.

SignData(Stream, HashAlgorithmName)

使用指定的哈希算法计算指定流的哈希值,并对生成的哈希值进行签名。Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value.

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

使用指定的哈希算法计算指定字节数组的一个部分的哈希值,并对生成的哈希值进行签名。Computes the hash value of a portion of the specified byte array using the specified hash algorithm and signs the resulting hash value.

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[]

要为其计算哈希的输入数据。The input data for which to compute the hash.

offset
Int32

数组中自其开始使用数据的偏移量。The offset into the array at which to begin using data.

count
Int32

数组中用作数据的字节数。The number of bytes in the array to use as data.

hashAlgorithm
HashAlgorithmName

要用于创建哈希值的哈希算法。The hash algorithm to use to create the hash value.

返回

Byte[]

指定数据的 DSA 签名。The DSA signature for the specified data.

异常

datanulldata is null.

hashAlgorithm.NamehashAlgorithm.Name nullEmptyis null or Empty.

offset 小于零。offset is less than zero.

- 或 --or- count 小于零。count is less than zero.

- 或 --or- offset + count - 1 会导致超出 data 上限的索引。offset + count - 1 results in an index that is beyond the upper bound of data.

SignData(Byte[], HashAlgorithmName)

使用指定的哈希算法计算指定字节数组的哈希值,并对生成的哈希值进行签名。Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value.

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[]

要为其计算哈希的输入数据。The input data for which to compute the hash.

hashAlgorithm
HashAlgorithmName

要用于创建哈希值的哈希算法。The hash algorithm to use to create the hash value.

返回

Byte[]

指定数据的 DSA 签名。The DSA signature for the specified data.

异常

datanulldata is null.

hashAlgorithm.NamehashAlgorithm.Name nullEmptyis null or Empty.

SignData(Stream, HashAlgorithmName)

使用指定的哈希算法计算指定流的哈希值,并对生成的哈希值进行签名。Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value.

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

要为其计算哈希的输入流。The input stream for which to compute the hash.

hashAlgorithm
HashAlgorithmName

要用于创建哈希值的哈希算法。The hash algorithm to use to create the hash value.

返回

Byte[]

指定数据的 DSA 签名。The DSA signature for the specified data.

异常

datanulldata is null.

hashAlgorithm.NamehashAlgorithm.Name nullEmptyis null or Empty.

适用于