public override bool Verify(X509Certificate2 thisCertificate)
 {
     using (var chain = new MonoBtlsX509Chain()) {
         chain.AddCertificate(x509.Copy());
         if (intermediateCerts != null)
         {
             for (int i = 0; i < intermediateCerts.Count; i++)
             {
                 var intermediate = (X509CertificateImplBtls)intermediateCerts [i];
                 chain.AddCertificate(intermediate.x509.Copy());
             }
         }
         return(MonoBtlsProvider.ValidateCertificate(chain, null));
     }
 }
Пример #2
0
        public static MonoBtlsX509Chain GetNativeChain(X509CertificateCollection certificates)
        {
            var chain = new MonoBtlsX509Chain();

            try {
                foreach (var cert in certificates)
                {
                    using (var x509 = GetBtlsCertificate(cert))
                        chain.AddCertificate(x509);
                }
                return(chain);
            } catch {
                chain.Dispose();
                throw;
            }
        }
Пример #3
0
		public static MonoBtlsX509Chain GetNativeChain (X509CertificateCollection certificates)
		{
			var chain = new MonoBtlsX509Chain ();
			try {
				foreach (var cert in certificates) {
					using (var x509 = GetBtlsCertificate (cert))
						chain.AddCertificate (x509);
				}
				return chain;
			} catch {
				chain.Dispose ();
				throw;
			}
		}
Пример #4
0
		public override bool Verify (X509Certificate2 thisCertificate)
		{
			using (var chain = new MonoBtlsX509Chain ()) {
				chain.AddCertificate (x509.Copy ());
				if (intermediateCerts != null) {
					for (int i = 0; i < intermediateCerts.Count; i++) {
						var intermediate = (X509CertificateImplBtls)intermediateCerts [i];
						chain.AddCertificate (intermediate.x509.Copy ());
					}
				}
				return MonoBtlsProvider.ValidateCertificate (chain, null);
			}
		}