Пример #1
0
        public static IConfigurationBuilder AddProtectedProvider(this IConfigurationBuilder builder, IFileProvider provider, string path, bool optional, bool reloadOnChange, string cipher)
        {
            if (provider == null && Path.IsPathRooted(path))
            {
                provider = new PhysicalFileProvider(Path.GetDirectoryName(path));
                path     = Path.GetFileName(path);
            }
            var source = new ProtectedConfigurationSource
            {
                FileProvider   = provider,
                Path           = path,
                Optional       = optional,
                ReloadOnChange = reloadOnChange,
                Cipher         = cipher
            };

            builder.Add(source);
            return(builder);
        }
Пример #2
0
 public ProtectedConfigurationProvider(string cipher, ProtectedConfigurationSource source) : base(source)
 {
     Cipher = cipher;
 }