You use Microsoft .NET Framework 4 to develop an ASP.NET 4 Web application. You need to encrypt the connection string information that is stored in the web.config file. The application is deployed to multiple servers. The encryption keys that are used to encrypt the connection string information must be explortable and importable on all the servers. You need to encrypt the connection string section of the web.config file so that the file can be used on all of the servers. Which code segment should you use?
Answer:
Configuration config = WebConfigurationManager.OpenWebConfiguration("...");
ConnectionStringsSection section = (ConnectionStringsSection) config.GetSection("connectionStrings");
section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvicer);
config.Save();
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.