Showing results for 
Show  only  | Search instead for 
Did you mean: 

Access Denied - System.Security.Cryptography.CryptographicException

I'm trying to port an ASP.NET web site over to Godaddy.  I set the trust level to "high" in the web.config (note: from the Plesk panel it seemed to mess up the web.config) and got a different error so I think that did something.  But now I'm stuck on this piece of code with an Access Denied.  (bold line).  I know this is a prayer but anything I can do other than re-write this piece of the app?

private static RSACryptoServiceProvider GetRSACryptoServiceProvider()
      if (_CspParams == null)
          _CspParams = new CspParameters();
          _CspParams.KeyContainerName = CONTAINER_NAME;
          _CspParams.Flags = CspProviderFlags.UseMachineKeyStore;

      if (_Rsa == null)
          _Rsa = new RSACryptoServiceProvider(_CspParams);  <<--- ERROR HERE
      return _Rsa;