Exemple #1
0
 internal static void DuplicateCertContext(IntPtr handle, SafeCertContextHandle safeCertContext)
 {
     X509Utils._DuplicateCertContext(handle, ref safeCertContext);
     if (!safeCertContext.IsInvalid)
     {
         GC.ReRegisterForFinalize(safeCertContext);
     }
 }
Exemple #2
0
 public X509Certificate(IntPtr handle) : this()
 {
     if (handle == IntPtr.Zero)
     {
         throw new ArgumentException(Environment.GetResourceString("Arg_InvalidHandle"), "handle");
     }
     X509Utils._DuplicateCertContext(handle, ref this.m_safeCertContext);
 }
Exemple #3
0
 public X509Certificate(X509Certificate cert) : this()
 {
     if (cert == null)
     {
         throw new ArgumentNullException("cert");
     }
     if (cert.m_safeCertContext.pCertContext != IntPtr.Zero)
     {
         X509Utils._DuplicateCertContext(cert.m_safeCertContext.pCertContext, ref this.m_safeCertContext);
     }
     GC.KeepAlive(cert.m_safeCertContext);
 }