DSA.SignData Method

Definition

Computes the hash value of the specified data and signs it.

Overloads

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()

Parameters

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.

Returns

Byte[]

The DSA signature for the specified data.

Exceptions

data is null.

hashAlgorithm.Name is null or Empty.

offset is less than zero.

-or-

count is less than zero.

-or-

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()

Parameters

data
Byte[]

The input data for which to compute the hash.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value.

Returns

Byte[]

The DSA signature for the specified data.

Exceptions

data is null.

hashAlgorithm.Name is 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()

Parameters

data
Stream

The input stream for which to compute the hash.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value.

Returns

Byte[]

The DSA signature for the specified data.

Exceptions

data is null.

hashAlgorithm.Name is null or Empty.

Applies to