RSACryptoServiceProvider.SignData Method (Stream, Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

member SignData : 
        inputStream:Stream *
        halg:Object -> byte[]


Type: System.IO.Stream

The input data for which to compute the hash.

Type: System.Object

The hash algorithm to use to create the hash value.

Return Value

Type: System.Byte[]

The RSA signature for the specified data.

Exception Condition

The halg parameter is null.


The halg parameter is not a valid type.

The halg parameter can accept a String, a HashAlgorithm, or a Type.

The following code example signs and verifies data.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Windows Phone Silverlight
Available since 7.1
Return to top