Ejemplo n.º 1
0
 public static X509Certificate2Collection LoadAllPublic()
 {
     using (SystemX509Store store = SystemX509Store.OpenExternal())
     {
         return(store.GetAllCertificates());
     }
 }
Ejemplo n.º 2
0
        public void CachingVerifyDisabledNullCacheSettings()
        {
            using (SystemX509Store store = SystemX509Store.OpenExternal())
            {
                m_resolver = new CertificateResolver(store, null);
                m_cache    = m_resolver.Cache;
                string domain = DomainIncubator;
                X509Certificate2Collection source = m_resolver.GetCertificatesForDomain(domain);

                Assert.Null(m_resolver.Cache);
                Assert.True(source.Count > 0);
            }
        }
Ejemplo n.º 3
0
        private CertificateResolver CreateResolver(bool cachingEnabled, int ttlSeconds, bool negativeCache)
        {
            if (m_certStore != null)
            {
                m_certStore.Dispose();
            }

            m_certStore     = SystemX509Store.OpenExternal();
            m_negativeCache = negativeCache;

            return(new CertificateResolver(
                       m_certStore,
                       new CacheSettings()
            {
                Name = TestCacheName,
                Cache = cachingEnabled,
                NegativeCache = negativeCache,
                CacheTTLSeconds = ttlSeconds
            }));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a DirectAgent instance using local certificate stores and the standard trust and cryptography models.
 /// </summary>
 /// <param name="domain">
 /// The local domain name managed by this agent.
 /// </param>
 public DirectAgent(string domain)
     : this(new StaticDomainResolver(domain), SystemX509Store.OpenPrivate().CreateResolver(),
            SystemX509Store.OpenExternal().CreateResolver(),
            TrustAnchorResolver.CreateDefault())
 {
 }