Frequently Asked Questions

Help Center Search

Using ASP.NET Cryptography Services with Your Web Site

Print this Article
Comment on this Article
Last Updated: August 27, 2007 8:57 AM

As part of our ongoing effort to provide the highest possible level of security, we have made an update to our hosting environment that may require a change to your account. We apologize for any inconvenience this may cause and appreciate your understanding and assistance in performing any necessary account changes.

If you use .NET cryptography services, you may need to update your cryptography code so that the service can locate the key store. This update is made in your ASP content file containing the cryptography code. The file may have a name, such as "cryptopage.aspx."

Note: You will only need to perform this update if your content file includes a code statement similar to the following example.

using( RSACryptoServiceProvider provider = new RSACryptoServiceProvider( 512 ))

The code in this example no longer works because it cannot locate the key store. Therefore, you will need to update the code similar to the following example.

CspParameters CSPParam = new CspParameters();
CSPParam.Flags = CspProviderFlags.UseMachineKeyStore;
using( RSACryptoServiceProvider provider = new RSACryptoServiceProvider( 512, CSPParam ) )

This updated code explicitly specifies the correct key store to use, ensuring that the cryptography service can locate it.