尝试访问正在使用(出于临时原因)加密的 system.web/identity 条目的Web服务时,我收到以下错误:

Failed to decrypt using provider 'DataProtectionConfigurationProvider'. Error message from the provider: The RSA key container could not be opened.

我已经按照http://blogs.msdn.com/mosharaf/archive/2005/11/17/protectedConfiguration.aspx中的评论中的步骤进行了操作,这些是我已经完成的步骤:

  • 将"xmlns=" http://schemas.microsoft.com/.NetConfiguration/v2.0“”添加到Web服务的web.config中的配置属性

  • 使用 aspnet_regiis -pc "DataProtectionConfigurationProviderKeys" -exp 创建容器

  • 在web.config中添加了以下内容: <configProtectedData> <providers> <clear /> <add name="DataProtectionConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,processorArchitecture=MSIL" keyContainerName="DataProtectionConfigurationProviderKeys" useMachineContainer="true" /> </providers> </configProtectedData>

  • 授予对IIS帐户的密钥容器的访问权限: aspnet_regiis -pa "DataProtectionConfigurationProviderKeys" "eca\iusr_xxxxx" . 我还使用相同的命令授予对模拟帐户(例如身份属性中的帐户)的访问权限 .

  • 然后我加密了system.web / identity条目: aspnet_regiis -pef "system.web/identity" "C:\ddrive\EcaDevelopment\EcaApplicationsNet2\Projects\TASV2\Mainline\src\TASV2.WordToPdf.WebSvc" -prov "DataProtectionConfigurationProvider"

但是,当我尝试针对Web服务运行我的测试工具时,我得到:

Failed to decrypt using provider 'DataProtectionConfigurationProvider'. Error message from the provider: The RSA key container could not be opened.

我错过了什么?我可以实际加密身份标签吗?我可以加密并使用connectionStrings没问题...