Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public ProtectedConfigurationProvider(string cipher, ProtectedConfigurationSource source) : base(source)
 {
     Cipher = cipher;
 }