Esempio n. 1
0
        public void LoadRSACertificateFromPEM()
        {
            var prov = new Tls13.Certificates.OpenSsl11.CertificateProvider();

            using (var cert = prov.LoadCertificate(rsaCertPEM, rsaKeyPEM))
            {
            }
        }
Esempio n. 2
0
        public LetoConnectionAdapter(LetoConnectionAdapterOptions options, ILoggerFactory loggerFactory)
        {
            _certList = new CertificateList();
            var provider = new Tls13.Certificates.OpenSsl11.CertificateProvider();

            _certList.AddCertificate(provider.LoadPfx12(options.PfxPath, options.PfxPassword));
            _listener = new SecurePipeListener(_pipeFactory, _certList, loggerFactory);
            _logger   = loggerFactory?.CreateLogger <LetoConnectionAdapter>();
        }
Esempio n. 3
0
 public void LoadEcdsaCertificateFromX509Certificate2()
 {
     using (var cert = new X509Certificate2(_ecdsaCertificate, _certificatePassword, X509KeyStorageFlags.Exportable))
     {
         var prov = new Tls13.Certificates.OpenSsl11.CertificateProvider();
         using (var cert2 = prov.LoadCertificate(cert, new X509CertificateCollection()))
         {
         }
     }
 }
Esempio n. 4
0
        public LetoConnectionFilter(LetoConnectionFilterOptions options, IConnectionFilter previous, ILoggerFactory loggerFactory)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (previous == null)
            {
                throw new ArgumentNullException(nameof(previous));
            }
            _factory         = new PipelineFactory();
            _certificateList = new CertificateList();
            var prov = new Tls13.Certificates.OpenSsl11.CertificateProvider();

            _certificateList.AddCertificate(prov.LoadPfx12(options.PfxPath, options.PfxPassword));
            _listener      = new SecurePipelineListener(_factory, _certificateList, loggerFactory);
            _previous      = previous;
            _loggerFactory = loggerFactory;
        }