Ejemplo n.º 1
0
        public CustomsReportHandler()
        {
            var settingProvider = new CustomsReportSettingProvider();

            _settings = settingProvider.GetCustomsReportSetting();

            _reporter = new CustomsPaymentReport();

            _customsReportDataProvider = new CustomsReportDataProvider();
        }
Ejemplo n.º 2
0
        private static HttpClientHandler GetCertificateHandler()
        {
            var handler = new WebRequestHandler();

            var provider = new CustomsReportSettingProvider();

            var setting = provider.GetCustomsReportSetting();


            var key               = GetCertCacheKey(setting.CertFilePath, setting.CertPassword);
            var certStream        = CertCache.GetOrAdd(key, ReadCertFile(setting.CertFilePath));
            X509Certificate2 cert = new X509Certificate2(certStream, setting.CertPassword);

            handler.ClientCertificates.Add(cert);

            return(handler);
        }