コード例 #1
0
        public void Test()
        {
            DummyX509Index      index    = new DummyX509Index();
            CertificateResolver resolver = new CertificateResolver(index, null);

            resolver.GetCertificates(new MailAddress("*****@*****.**"));
            Assert.True(index.Log.Count == 2);
            Assert.True(index.Log[0] == "*****@*****.**");
            Assert.True(index.Log[1] == "redmond.hsgincubator.com");
        }
コード例 #2
0
        private void CachingVerifyFallbackAddresses()
        {
            MailAddress address = new MailAddress(UserAtDomainIncubator);

            X509Certificate2Collection source              = m_resolver.GetCertificates(address);
            X509Certificate2Collection cachedUserAnchors   = m_cache.Get(UserAtDomainIncubator);
            X509Certificate2Collection cachedDomainAnchors = m_cache.Get(address.Host);

            if (m_negativeCache)
            {
                Assert.NotNull(cachedUserAnchors);
                Assert.True(cachedUserAnchors.Count == 0);
            }
            else
            {
                Assert.Null(cachedUserAnchors);
            }

            VerifyValidCert(source, cachedDomainAnchors);
        }