RSACryptoServiceProvider CryptographicException Sistema não é possível localizar o arquivo especificado em ASP.NET

Eu tenho um aplicativo que está fazendo uso do RSACryptoServiceProvider para descriptografar alguns dados usando uma chave privada conhecida (armazenada em uma variável).

Quando o pool de aplicativos do IIS está configurado para usar o serviço de rede, tudo é executado corretamente.

No entanto, quando configuramos o pool de aplicativos do IIS para executar o código em uma identidade diferente, obtemos o seguinte:

System.Security.Cryptography.CryptographicException: The system cannot find the file specified.

   at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
   at System.Security.Cryptography.RSACryptoServiceProvider.ImportParameters(RSAParameters parameters)
   at System.Security.Cryptography.RSA.FromXmlString(String xmlString)

O código é algo assim:

byte[] input; 
byte[] output; 
string private_key_xml; 

var provider = new System.Cryptography.RSACryptoServiceProvider(this.m_key.Key_Size);
provider.FromXmlString(private_key_xml); // Fails Here when Application Pool Identity != Network Service

ouput = provider.Decrypt(input, false); // False = Use PKCS#1 v1.5 Padding

Existem recursos que tentam responder afirmando que você deve conceder ao usuário acesso de leitura ao keystore da máquina - no entanto, não há uma resposta definitiva para resolver esse problema.

Ambiente: IIS 6.0, Windows Server 2003 R2, .NET 3.5 SP1

questionAnswers(4)

yourAnswerToTheQuestion