70-516 · Question #112
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Forms application. You plan to deploy the application to several shared client computers. You write the…
The correct answer is D. ConnectionStringsSection section =. You encrypt and decrypt the contents of a Web.config file by using System.Configuration . DPAPIProtectedConfigurationProvider, which uses the Windows Data Protection API (DPAPI) to encrypt and decrypt data, or System.Configuration. RSAProtectedConfigurationProvider, which uses…
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Forms application. You plan to deploy the application to several shared client computers. You write the following code segment. (Line numbers are included for reference only.) 01 Configuration config = ConfigurationManager.OpenExeConfiguration(exeConfigName); 02 ... 03 config.Save(); 04 ... You need to encrypt the connection string stored in the .config file. Which code segment should you insert at line 02?
Options
- AConnectionStringsSection section =
- BConnectionStringsSection section =
- CConnectionStringsSection section =
- DConnectionStringsSection section =
How the community answered
(43 responses)- A5% (2)
- B2% (1)
- C14% (6)
- D79% (34)
Explanation
You encrypt and decrypt the contents of a Web.config file by using System.Configuration . DPAPIProtectedConfigurationProvider, which uses the Windows Data Protection API (DPAPI) to encrypt and decrypt data, or System.Configuration. RSAProtectedConfigurationProvider, which uses the RSA encryption algorithm to encrypt and decrypt data. When you use the same encrypted configuration file on many computers in a Web farm, only System.Configuration.RSAProtectedConfigurationProvider enables you to export the encryption keys that encrypt the data and import them on another server. This is the default CHAPTER 2 ADO.NET Connected Classes Lesson 1: Connecting to the Data Store Storing Encrypted Connection Strings in Web Applications (page 76) Securing Connection Strings
Topics
Community Discussion
No community discussion yet for this question.