"的RSA密钥容器不能打开"即使ACL权限后的错误(对于某些用户) [英] "The RSA key container could not be opened" Error even after ACL Permission (for some users)

查看:440
本文介绍了"的RSA密钥容器不能打开"即使ACL权限后的错误(对于某些用户)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在应用加密我们得到以下错误(在asp.net网站)。

We are getting the following error (in asp.net website) when applied encryption.

分析器错误信息:无法使用提供解密RsaProtectedConfigurationProvider。从提供的错误信息:的RSA密钥容器不能打开

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

请注意:请参考下面,我们遵循列出的步骤。 (我们已经授予ACL权限NT AUTHORITY \\ Network服务上NetFrameworkConfigurationKey)

Note: Please see the steps listed below that we followed. (We have granted ACL permission for NT Authority\Network Service on NetFrameworkConfigurationKey)

请注意:我们在使用Windows身份验证并启用ASP.NET模拟中的 IIS7 已启用。它在的Windows Server 2008 运行。访问是基于用户是否允许AD组(将在配置文件中列出)的一部分控制。

Note: We are using Windows Authentication Enabled and ASP.NET impersonation Enabled in IIS7. It is running in Windows Server 2008. The access is controlled based on whether a user is part of allowed AD group (which will be listed in config file).

有趣的是,这个错误发生在1组的用户(从LOCATION1)访问它。当组2(从locatiob2)的用户尝试访问它,误差不来的。

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.

这是如何纠正它有什么想法?

Any thoughts on how to correct it?

我们遵循了我们的部署文件下面列出的步骤。

We have followed the steps listed below from our deployment document.


  1. 运行在管理员模式下的命令窗口。 (在Windows Server 2008中,键入cmd,preSS CTRL + SHIFT + Enter)

  2. 转至文件夹C:\\ WINDOWS \\ Microsoft.Net \\框架\\ v4.0.30319 \\使用更改目录命令(CD)

  3. 键入以下命令来创建RSA密钥容器。为aspnet_regiis -pcNetFrameworkConfigurationKey-exp

  4. 键入以下(添加ACL用于访问RSA密钥容器)和preSS如果输入为aspnet_regiis -paNetFrameworkConfigurationKey,NT AUTHORITY \\ Network服务

  5. 键入以下命令preSS(与那里的服务部署的位置替换突出显示的文本之后)输入到服务的web.config中的连接字符串加密。 ASPNET_REGIIS.EXE -pef是connectionStringsC:\\ MyWCF \\服务名称

  6. 键入以下命令preSS(与那里的网站部署的位置替换突出显示的文本之后)输入到网站的web.config中的连接字符串加密。 ASPNET_REGIIS.EXE -pef是connectionStringsC:\\ MyWeb即可\\ WebsiteName

  7. 键入以下命令preSS(与在为网站的web.config文件可用的位置替换突出显示的文本之后)输入来加密网站的web.config中的sessionState值。 ASPNET_REGIIS.EXE -pef的System.Web /的sessionStateC:\\ MyWeb即可\\ WebsiteName

  8. 验证连接字符串和SessionState会值进行加密。

  9. 验证在machine.config中configProtectedData节以下详细信息。

•验证defaultProvider =RsaProtectedConfigurationProvider

• Verify that defaultProvider="RsaProtectedConfigurationProvider"

•验证keyContainerName =NetFrameworkConfigurationKey

• Verify that keyContainerName="NetFrameworkConfigurationKey"

注:machine.config中的默认位置为C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\ Config中

Note: Default location for machine.config is C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config

推荐答案

下面是一个不涉及机器配置的方法。

Following is an approach that does not involve Machine config.

请注意:下面列出的某些命令可能需要手工编写。复制粘贴到命令提示符下可能无法正常工作。

Note: Certain commands listed below might need to be written by hand. Copy pasting into command prompt might not work.

请注意:如果目标是Windows Sever的2008年,请执行在Windows Server 2008本身的加密步骤

Note: If the destination is in Windows Sever 2008, please execute the encryption steps in a Windows Server 2008 itself.

运行低于codeS服务器A

Run the below codes in server A

请注意: - 注册键

 cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
 aspnet_regiis.exe -pc "MyProjectKeys" -exp

请注意: - 授予在服务器A上仅访问

Note:- GRANTING ACCESS on SERVER A only

aspnet_regiis.exe -pa "MyProjectKeys" "IIS APPPOOL\testpsreloservices"
aspnet_regiis.exe -pa "MyProjectKeys" "NT AUTHORITY\NETWORK"

包含RSA密钥导出XML文件

Export XML file containing RSA Key

aspnet_regiis.exe -px "MyProjectKeys" E:\wmapps\webroot\myservice\MyProjectKey.xml –pri

添加以下web.config中

Add the following in web.config

<configProtectedData>
  <providers>
    <clear/>
<remove name="RSAProtectedConfigurationProvider" />
     <add name="RSAProtectedConfigurationProvider" keyContainerName="MyProjectKeys" 
    type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0,&#xD;&#xA;                
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,&#xD;&#xA; processorArchitecture=MSIL"
          useMachineContainer="true" />
  </providers>
</configProtectedData>

加密

aspnet_regiis -pef "connectionStrings" "E:\wmapps\webroot\myservice" -prov "RsaProtectedConfigurationProvider"

加密的文件复制B中服务器。
关键的XML文件复制到对B服务器。

Copy the encrypted files in B Server. Copy the key xml file into the B Server.

创建具有以下命令的批处理文件和执行(关键注册和授权访问)

Create batch file with the following commands and Execute (for Key registration and granting access)

c:
cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe -pi "MyProjectKeys" E:\wmapps\webroot\myservice\MyProjectKey.xml
aspnet_regiis.exe -pa "MyProjectKeys" "IIS APPPOOL\testpsreloservices"
aspnet_regiis.exe -pa "MyProjectKeys" "NT AUTHORITY\NETWORK"

这篇关于&QUOT;的RSA密钥容器不能打开&QUOT;即使ACL权限后的错误(对于某些用户)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆