繁体   English   中英

使用RsaProtectedConfigurationProvider的ProtectSection Key在哪里?

[英]ProtectSection with RsaProtectedConfigurationProvider where does the Key go?

我正在使用System.Configuration来加密和保护自定义配置部分中的某些密码: - 。

static public void SetPassAndProtectSection(string newPassword)
{

    // Get the current configuration file.
    System.Configuration.Configuration config =
        ConfigurationManager.OpenExeConfiguration(
        ConfigurationUserLevel.None);


    // Get the section.
    MyAppProtectedSection section = 
        (MyAppProtectedSection)config.GetSection(DEFAULT_SECTION_NAME);

    section.DBPassword = newPassword;

    // Protect (encrypt)the section.
    section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");

    // Save the encrypted section.
    section.SectionInformation.ForceSave = true;

    config.Save(ConfigurationSaveMode.Full);
}

这似乎工作正常,但我需要一些额外的信息,我的文档。

密钥存储在哪里?

钥匙有多长?

用户级别密钥存储在

\\ Documents and Settings {UserName} \\ Application Data \\ Microsoft \\ Crypto \\ RSA

机器级钥匙在

\\ Documents and Settings \\ All Users \\ Application Data \\ Microsoft \\ Crypto \\ RSA \\ MachineKeys

您的是用户级密钥。

我有一个场景,我需要授予本地服务帐户访问Windows 2012服务器上的RsaProtectedConfigurationProvider密钥的权限。

最后,授予对C:\\ ProgramData \\ Microsoft \\ Crypto \\ RSA \\ MachineKeys的访问权限。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM