Exemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (chain != null)
         {
             chain.Dispose();
             chain = null;
         }
         if (storeCtx != null)
         {
             storeCtx.Dispose();
             storeCtx = null;
         }
         if (untrustedChain != null)
         {
             untrustedChain.Dispose();
             untrustedChain = null;
         }
         if (untrusted != null)
         {
             foreach (var cert in untrusted)
             {
                 cert.Dispose();
             }
         }
     }
     base.Dispose(disposing);
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
			}
		}