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); }
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; } }
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; } }