title: Unable to export RSA Key container file
body: <p>I need to encrypt my web.config file on my dev machine (Windows XP SP-3) and export the RSA Key to my QA machine (Windows Server 2003). I used the following command to encrypt my file.</p>
  
  <pre><code>aspnet_regiis -pe "appSettings" -app "/VirtualDirectoryName" -prov "RsaProtectedConfigurationProvider"
  </code></pre>
  
  <p>and then i added the following section in my web.config file</p>
  
  <pre><code>&lt;configProtectedData&gt;
  </code></pre>
  
  <p>
     
    </p>
  
  <p>Then i created the RSA container with the name "<strong>SampleKeys</strong>"</p>
  
  <p>Web.Config was encrypted nicely and i was able to use this file on my dev machine. I however had to turn on "Impersonation" and used my windows userName and password.</p>
  
  <p>I need to export my RSA Key to QA server, so that i can use my the encrypted config file.
  So i'm trying to export the RSA key and its failing. I don't understand the reason, as i'm following all the steps that are mentioned in the following link;
  <a href="http://msdn.microsoft.com/en-us/library/yxw286t2" rel="nofollow noreferrer" title="http://msdn.microsoft.com/en-us/library/yxw286t2">link text</a></p>
  
  <p>When i try to export the RSA container, i get the error saying that the "RSA container was not found." But when i try to create the RSA container again with the same name, i get the error stating "The RSA container already exists". 
  <img src="https://i.stack.imgur.com/PRAmf.jpg" alt="alt text"></p>
  
  <p>even the following command executed successfully.</p>
  
  <pre><code>aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"
  </code></pre>
  
  <p>I however could not execute the following command;</p>
  
  <pre><code>aspnet_regiis -pa "SampleKeys" "NT AUTHORITY\NETWORK SERVICE"
  </code></pre>
  
  <p>I got the same error saying that "RSA container was not found."</p>
  
  <p>I also gave read access to ASPNET user on "C:\Document and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKey" folder.
  but nothing worked.</p>
  
  <p>Am i missing something?</p>