Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

RSACryptoServiceProvider::SignHash Method (array<Byte>^, HashAlgorithmName, RSASignaturePadding^)

 

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

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public:
virtual array<unsigned char>^ SignHash(
	array<unsigned char>^ hash,
	HashAlgorithmName hashAlgorithm,
	RSASignaturePadding^ padding
) override

Parameters

hash
Type: array<System::Byte>^

The hash value of the data to be signed.

hashAlgorithm
Type: System.Security.Cryptography::HashAlgorithmName

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

padding
Type: System.Security.Cryptography::RSASignaturePadding^

The padding.

Return Value

Type: array<System::Byte>^

The RSA signature for the specified hash value.

Exception Condition
ArgumentException

hashAlgorithm is null or String::Empty.

ArgumentNullException

hash is null.

-or-

padding is null.

CryptographicException

padding does not equal RSASignaturePadding::Pkcs1.

.NET Framework
Available since 4.6
Return to top
Show:
© 2017 Microsoft