D
dpomt
Hello,
I have an issue exporting a RSA key container via aspnet_regiis.
I am using
aspnet_regiis -px "HoKeyCont7" HoKeyCont7.xml -pri
and I get the following (german) error message:
Exporting RSA Keys to file...
Schlüssel ist im angegebenen Status nicht gültig.
(translation might be: key invalid in specified status)
If I ommit the "-pri" option, the export succeeds without errors. However, I
need the "-pri" option to use the RSA key to decrypt the encrypted stuff on
a webserver.
Background information:
I have added a configProtectedData section to my web.config
<configProtectedData>
<providers>
<add name="MyProtectedDataProviderName2"
type="System.Configuration.RsaProtectedConfigurationProvider,
System.Configuration, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
keyContainerName="HoKeyCont7"
useMachineContainer="true" />
</providers>
</configProtectedData>
and I am encrypting the wanted section programmatically:
Configuration config = WebConfigurationManager.OpenMappedWebConfiguration
(webConfigurationFileMap, "/");
ConfigurationSection cs = config.GetSection(strSection);
cs.SectionInformation.ProtectSection(m_strProtectedDataProviderName);
config.Save();
Encryption (as well as decryption) on my local dev machine work both well.
What I need is to export the RSA key with the -pri option.
Any suggestions?
I have an issue exporting a RSA key container via aspnet_regiis.
I am using
aspnet_regiis -px "HoKeyCont7" HoKeyCont7.xml -pri
and I get the following (german) error message:
Exporting RSA Keys to file...
Schlüssel ist im angegebenen Status nicht gültig.
(translation might be: key invalid in specified status)
If I ommit the "-pri" option, the export succeeds without errors. However, I
need the "-pri" option to use the RSA key to decrypt the encrypted stuff on
a webserver.
Background information:
I have added a configProtectedData section to my web.config
<configProtectedData>
<providers>
<add name="MyProtectedDataProviderName2"
type="System.Configuration.RsaProtectedConfigurationProvider,
System.Configuration, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
keyContainerName="HoKeyCont7"
useMachineContainer="true" />
</providers>
</configProtectedData>
and I am encrypting the wanted section programmatically:
Configuration config = WebConfigurationManager.OpenMappedWebConfiguration
(webConfigurationFileMap, "/");
ConfigurationSection cs = config.GetSection(strSection);
cs.SectionInformation.ProtectSection(m_strProtectedDataProviderName);
config.Save();
Encryption (as well as decryption) on my local dev machine work both well.
What I need is to export the RSA key with the -pri option.
Any suggestions?