1.创建一个RSA密钥容器
 aspnet_regiis -pc "MyKeys" -exp

2.授予asp.net标识对RSA容器的访问权限
      aspnet_regiis -pa "MyKeys" "NT AUTHORITY\NETWORK SERVICE"

3.在Web.config 中指定加密保护提供程序(Provider)
 <configuration>
   <configProtectedData>
     <add name="MyProvider"
   type="System.Cofiguration.RsaProtectedConfigurationProvider"
   keyContainerName="MyKeys"
   useMachineContainer="true" />
   </configProtectedData>
 </configuration>

4. 加密<connectionStrings>节
 aspnet_regiis -pe "connectionStrings" -app "/MyApp" -prov "MyProvider"


5. 导出RSA 密钥容器
 aspnet_regiis -px "MyKeys"  "c:\keys.xml" -pri


6. 删除RSA密钥容器
 aspnet_regiis -pz "MyKeys"

7.从XML中导入RSA 密钥容器
 aspnet_regiis -pi "MyKeys" "c:\keys.xml"

8.授予asp.net标识对RSA容器的访问权限
      aspnet_regiis -pa "MyKeys" "NT AUTHORITY\NETWORK SERVICE"

相关文章:

  • 2021-12-13
  • 2021-07-10
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-10
  • 2022-02-12
  • 2021-12-17
相关资源
相似解决方案