public PublicPolicyResolver(PublicPolicyServiceResolverSettings settings)
        {
            PublicPolicyServiceResolverSettings settings1 = settings;

            CacheSettings incomingCacheSettings =
                new CacheSettings(settings1.CacheSettings)
            {
                Name = "publicPolicy.incoming"
            };

            CacheSettings outgoingCacheSettings =
                new CacheSettings(settings1.CacheSettings)
            {
                Name = "publicPolicy.outgoing"
            };

            m_incomingResolver =
                new PolicyResolver(new CertPolicyIndex(settings1.ClientSettings, true, CertPolicyUse.PUBLIC_RESOLVER), incomingCacheSettings);

            m_outgoingResolver =
                new PolicyResolver(new CertPolicyIndex(settings1.ClientSettings, false, CertPolicyUse.PUBLIC_RESOLVER), outgoingCacheSettings);
        }
Example #2
0
        void Verify(PolicySettings settings)
        {
            Assert.NotNull(settings.Resolvers);
            Assert.Equal(3, settings.Resolvers.Count());
            IPolicyResolver trustResolver   = settings.Resolvers.FirstOrDefault(r => r.Name == CertPolicyResolvers.TrustPolicyName).CreateResolver();
            IPolicyResolver privateResolver = settings.Resolvers.FirstOrDefault(r => r.Name == CertPolicyResolvers.PrivatePolicyName).CreateResolver();
            IPolicyResolver publicResolver  = settings.Resolvers.FirstOrDefault(r => r.Name == CertPolicyResolvers.PublicPolicyName).CreateResolver();

            Assert.NotNull(trustResolver);
            Assert.NotNull(privateResolver);
            Assert.NotNull(publicResolver);

            TrustPolicyServiceResolverSettings trustSettings =
                settings.Resolvers.FirstOrDefault(r => r.Name == CertPolicyResolvers.TrustPolicyName) as
                TrustPolicyServiceResolverSettings;

            Assert.True(trustSettings.CacheSettings.Cache);
            Assert.True(trustSettings.CacheSettings.NegativeCache);
            Assert.Equal(60, trustSettings.CacheSettings.CacheTTLSeconds);

            PrivatePolicyServiceResolverSettings privateSettings =
                settings.Resolvers.FirstOrDefault(r => r.Name == CertPolicyResolvers.PrivatePolicyName) as
                PrivatePolicyServiceResolverSettings;

            Assert.True(privateSettings.CacheSettings.Cache);
            Assert.True(privateSettings.CacheSettings.NegativeCache);
            Assert.Equal(60, privateSettings.CacheSettings.CacheTTLSeconds);


            PublicPolicyServiceResolverSettings publicSettings =
                settings.Resolvers.FirstOrDefault(r => r.Name == CertPolicyResolvers.PublicPolicyName) as
                PublicPolicyServiceResolverSettings;

            Assert.True(publicSettings.CacheSettings.Cache);
            Assert.True(publicSettings.CacheSettings.NegativeCache);
            Assert.Equal(60, publicSettings.CacheSettings.CacheTTLSeconds);
        }