<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings configSource="appSettings.config"/>
<connectionStrings configSource="connections.config"/>
<system.web>
<compilation debug="true" />
<authentication mode="Windows"/>
<identity impersonate="true"/>
</system.web>
</configuration>
上記web.config
は、MVC
Webアプリケーションで使用されています。 RsaProtectedConfigurationProvider
をaspnet_regiisで暗号化しようとしました。しかし、単純にWeb.config
で期待通りに動作しません。appSettings
とconnectionStrings
が同じファイルに存在します。web.configで外部appSettingsとconnectionStringsを暗号化できますか?
私は、web.configファイル
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pef "connectionStrings" "D:\WebApplication" -prov "AppEncryptionProvider".
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pef "appSettings" "D:\WebApplication" -prov "AppEncryptionProvider".
を暗号化するためにコマンドを使用していますが、以下のように、Webアプリケーションでこれを使用している間、それは私にエラーを与える:プロバイダを使用して復号化に失敗しました「AppEncryptionProvider」。プロバイダからのエラーメッセージ:指定されたファイルが見つかりません。 (HRESULTからの例外:0x80070002)
Line 1: <appSettings configProtectionProvider="AppEncryptionProvider">
Line 2: <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
Line 3: xmlns="http://www.w3.org/2001/04/xmlenc#">
Line 4: <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
そして、これは 'appSettings.config'と' connection.config'ファイルを暗号化するのだろうか?あるいは、 'web.config'で直接何が暗号化されるだけでしょうか? – mason
これもファイルを暗号化します –