Пример #1
0
        private void VerifyValidCert(X509Certificate2Collection source, X509Certificate2Collection cached)
        {
            Assert.NotNull(source);
            Assert.NotNull(cached);
            Assert.True(cached.Count > 0);
            Assert.Equal(source.Count, cached.Count);

            source.Enumerate().All((x) => cached.FindByThumbprint(x.Thumbprint) != null);
            cached.Enumerate().All((x) => source.FindByThumbprint(x.Thumbprint) != null);
        }
Пример #2
0
 /// <summary>
 /// Gets an enumeration of the certificates for this store.
 /// </summary>
 /// <returns>An enumeration of the certificates for this store.</returns>
 public override IEnumerator<X509Certificate2> GetEnumerator()
 {
     X509Certificate2Collection certs;
     lock(m_certs)
     {
         certs = new X509Certificate2Collection(m_certs);
     }
     return certs.Enumerate().GetEnumerator();
 }
Пример #3
0
 //---------------------------------------
 //
 // Implementation...
 //
 //---------------------------------------
 void ExportCert(X509Certificate2 cert, string filepath)
 {
     X509Certificate2Collection certs = new X509Certificate2Collection(cert);
     this.ExportCerts(certs.Enumerate(), filepath);
 }