Edit

Share via


DSACryptoServiceProvider.SignHash(Byte[], String) Method

Definition

Computes the signature for the specified hash value by encrypting it with the private key.

public:
 cli::array <System::Byte> ^ SignHash(cli::array <System::Byte> ^ rgbHash, System::String ^ str);
public byte[] SignHash (byte[] rgbHash, string? str);
public byte[] SignHash (byte[] rgbHash, string str);
member this.SignHash : byte[] * string -> byte[]
Public Function SignHash (rgbHash As Byte(), str As String) As Byte()

Parameters

rgbHash
Byte[]

The hash value of the data to be signed.

str
String

The name of the hash algorithm used to create the hash value of the data.

Returns

Byte[]

The DSA signature for the specified hash value.

Exceptions

The rgbHash parameter is null.

The cryptographic service provider (CSP) cannot be acquired.

-or-

There is no private key.

Remarks

This method creates a digital signature that is verified using the VerifyHash method.

DSA uses the SHA1 hash algorithm.

Applies to

See also