Working with SHA-256

In order to sign and validate an SHA-256 signature, please ensure:
1. If you use .NET 4.5

Add a reference to the System.Deployment assembly.
Add the following code segment to your application’s bootstrap:

using System.Security.Cryptography;
using System.Deployment.Internal.CodeSigning;
protected void Application_Start(object sender, EventArgs e)
	Enable SHA-256 XML signature support.

2. If you use .NET 3.5 and 4.0

Make sure the following exists in your machine.config file for corresponding .NET Framework (both 32 and 64 bits)

<cryptoClass RSASHA256SignatureDescription=”Security.Cryptography.RSAPKCS1SHA256SignatureDescription, Security.Cryptography, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />
<nameEntry name=”” />

Download the security extension library at:
Add reference to the newly downloaded assembly

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>