public override ICertificateResolver CreateResolver()
        {
            ConfigCertificateResolver resolver = new ConfigCertificateResolver(this.ClientSettings);

            resolver.OrgCertificatesOnly = this.OrgCertificatesOnly;
            return(resolver);
        }
Esempio n. 2
0
        void RunTest(bool validateAddress, bool secure)
        {
            ConfigCertificateResolver resolver = this.CreateResolver(validateAddress, secure);

            X509Certificate2Collection matches = resolver.GetCertificates(new MailAddress("*****@*****.**"));

            Assert.True(!matches.IsNullOrEmpty());

            matches = resolver.GetCertificates(new MailAddress("*****@*****.**"));
            Assert.True(!matches.IsNullOrEmpty());
            //
            // This address does not exist, but should find org cert
            //
            matches = resolver.GetCertificates(new MailAddress("*****@*****.**"));
            Assert.True(!matches.IsNullOrEmpty());
            this.VerifyIsOrgCert(matches, "nhind.hsgincubator.com");
            //
            // This should match NOTHING, since no org or address
            //
            matches = resolver.GetCertificates(new MailAddress("*****@*****.**"));
            Assert.True(matches.IsNullOrEmpty());
            //
            // Should return ORG cert only
            //
            resolver.OrgCertificatesOnly = true;
            matches = resolver.GetCertificates(new MailAddress("*****@*****.**"));
            Assert.True(!matches.IsNullOrEmpty());
            this.VerifyIsOrgCert(matches, "redmond.hsgincubator.com");
        }
 public override ICertificateResolver CreateResolver()
 {
     ConfigCertificateResolver resolver = new ConfigCertificateResolver(this.ClientSettings);
     resolver.OrgCertificatesOnly = this.OrgCertificatesOnly;
     return resolver;
 }