title: How to set the key size for RSAProtectedConfigurationProvider from the code
body: <p>My application has a possibility to protect chosen config file. This is done using <a href="http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.protectsection.aspx"><code>SectionInformation.ProtectSection</code></a> method for specified section of loaded <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx"><code>Configuration</code></a>. I'm using standard provider <a href="http://msdn.microsoft.com/en-us/library/system.configuration.rsaprotectedconfigurationprovider.aspx"><code>RsaProtectedConfigurationProvider</code></a>.</p>
  
  <p>The code is quite simple - very similar to <a href="http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.protectsection.aspx">example on MSDN</a>.</p>
  
  <p>Is there any way to set the key size that should be used by provider? As I know, the default one for RSA is 1024. I need to set it up to 2048 or bigger.</p>
  
  <p>The similar can be done using command line option <strong>-size</strong> when we use <strong>asp_regiis.exe</strong>. But I need to do it from the code. Maybe there is any way to configure <code>RsaProtectedConfigurationProvider</code> or pre-create key and inject it somehow to the default key store so next using of <code>SectionInformation.ProtectSection</code> will catch up it...</p>
  
  <p>Thanks for any advice or examples.</p>