Exemple #1
0
        protected internal virtual ICertificateResolver CreateCertificateResolver()
        {
            var applicationDomain        = new ApplicationHost(AppDomain.CurrentDomain, this.HostEnvironment);
            var fileCertificateResolver  = new FileCertificateResolver(applicationDomain);
            var storeCertificateResolver = new StoreCertificateResolver();

            return(new CertificateResolver(fileCertificateResolver, storeCertificateResolver));
        }
        public ServiceConfigurationBuilder(IConfiguration configuration, IHostEnvironment hostEnvironment)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (hostEnvironment == null)
            {
                throw new ArgumentNullException(nameof(hostEnvironment));
            }

            var applicationDomain = new ApplicationHost(AppDomain.CurrentDomain, hostEnvironment);

            this.ApplicationDomain = applicationDomain;

            var fileCertificateResolver  = new FileCertificateResolver(applicationDomain);
            var storeCertificateResolver = new StoreCertificateResolver();

            this.CertificateResolver = new CertificateResolver(fileCertificateResolver, storeCertificateResolver);

            this.Configuration = configuration;

            var data = new DataOptions();

            configuration.GetSection(ConfigurationKeys.DataPath).Bind(data);
            this.Data = data;

            var development = new DevelopmentOptions();

            configuration.GetSection(ConfigurationKeys.DevelopmentPath).Bind(development);
            this.Development = development;

            this.FeatureManager  = new ConfigurationFeatureManager(configuration);
            this.HostEnvironment = hostEnvironment;
            this.InstanceFactory = new InstanceFactory();
        }