DSA.SignData Method

Definition

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

Overloads

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[], HashAlgorithmName, DSASignatureFormat)

Computes the hash value of the specified data and signs it using the specified signature format.

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

Computes the hash value of the specified data and signs it using the specified signature format.

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[], Int32, Int32, HashAlgorithmName, DSASignatureFormat)

Computes the hash value of the specified data and signs it using the specified signature format.

SignData(Byte[], HashAlgorithmName)

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

Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value.

C#
public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);

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.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1

SignData(Stream, HashAlgorithmName)

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

Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value.

C#
public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);

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

.NET 10 ja muud versioonid
Toode Versioonid
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

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

Computes the hash value of the specified data and signs it using the specified signature format.

C#
public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);

Parameters

data
Byte[]

The data to sign.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value.

signatureFormat
DSASignatureFormat

The encoding format to use for the signature.

Returns

Byte[]

The DSA signature for the specified data.

Exceptions

data is null.

signatureFormat is not a known format.

hashAlgorithm has a null or empty Name.

An error occurred in the hashing or signing operation.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid
.NET 5, 6, 7, 8, 9, 10

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

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

Computes the hash value of the specified data and signs it using the specified signature format.

C#
public byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);

Parameters

data
Stream

The data to sign.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value.

signatureFormat
DSASignatureFormat

The encoding format to use for the signature.

Returns

Byte[]

The DSA signature for the specified data.

Exceptions

data is null.

signatureFormat is not a known format.

hashAlgorithm has a null or empty Name.

An error occurred in the hashing or signing operation.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid
.NET 5, 6, 7, 8, 9, 10

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

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

Computes the hash value of a portion of the specified byte array using the specified hash algorithm and signs the resulting hash value.

C#
public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);

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.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1

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

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

Computes the hash value of the specified data and signs it using the specified signature format.

C#
public byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);

Parameters

data
Byte[]

The data to sign.

offset
Int32

The offset into data at which to begin hashing.

count
Int32

The number of bytes to read from data.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value.

signatureFormat
DSASignatureFormat

The encoding format to use for the signature.

Returns

Byte[]

The DSA signature for the specified data.

Exceptions

data is null.

signatureFormat is not a known format.

-or- 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.

hashAlgorithm has a null or empty Name.

An error occurred in the hashing or signing operation.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid
.NET 5, 6, 7, 8, 9, 10