예제 #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);
 }
예제 #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;
			}
		}