title: "The RSA key container could not be opened" Error even after ACL Permission (for some users)
body: <p>We are getting the following error (in asp.net website) when applied encryption. </p>
  
  <p>Parser Error Message: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: <strong>The RSA key container could not be opened.</strong></p>
  
  <p>Note: Please see the steps listed below that we followed. (We have granted ACL permission for NT Authority\Network Service on NetFrameworkConfigurationKey)</p>
  
  <p>Note: We are using Windows Authentication Enabled  and ASP.NET impersonation Enabled in <strong>IIS7</strong>. It is running in <strong>Windows Server 2008</strong>. The access is controlled based on whether a user is part of allowed AD group (which will be listed in config file).</p>
  
  <p><em><strong>The interesting part is that this error happens when users of group1 (from location1) access it. When users of group2 (from locatiob2) try to access it, the error does not come.</em></strong></p>
  
  <p>Any thoughts on how to correct it?</p>
  
  <p>We have followed the steps listed below from our deployment document.</p>
  
  <ol>
  <li>Run the Command Window in Administrator Mode. (In Windows Server 2008 , type cmd and press CTRL+SHIFT+ENTER)</li>
  <li>Go to the folder C:\Windows\Microsoft.Net\Framework\v4.0.30319\ using change directory command (cd).</li>
  <li>Type the following command to create RSA Key Container. aspnet_regiis -pc "NetFrameworkConfigurationKey" –exp</li>
  <li>Type the following (to add ACL for access to the RSA Key Container) and press enter <strong>aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT Authority\Network Service"</strong></li>
  <li>Type the following (after replacing the highlighted text with the location where the service is deployed) and press enter to encrypt the connections string in Service’s Web.Config. aspnet_regiis.exe -pef "connectionStrings" "C:\MyWCF\ServiceName"</li>
  <li>Type the following (after replacing the highlighted text with the location where the website is deployed) and press enter to encrypt the connections string in Website’s Web.Config. aspnet_regiis.exe -pef "connectionStrings" "C:\MyWeb\WebsiteName"</li>
  <li>Type the following (after replacing the highlighted text with the location where the web.config file for the website is available) and press enter to encrypt the sessionState values in Website’s Web.Config. aspnet_regiis.exe -pef "system.web/sessionState" "C:\MyWeb\WebsiteName"</li>
  <li>Verify that the connection strings and SessionState values are encrypted.</li>
  <li>Verify the following details in configProtectedData section in Machine.Config. </li>
  </ol>
  
  <p>•   Verify that defaultProvider="RsaProtectedConfigurationProvider"</p>
  
  <p>•   Verify that keyContainerName="NetFrameworkConfigurationKey"</p>
  
  <p>Note: Default location for machine.config is C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config</p>