Exemplo n.º 1
0
 /// <summary>
 /// Loads certificates from a LocalMachine Certificate store named "NHINAnchors"
 /// </summary>
 public static TrustAnchorResolver CreateDefault()
 {
     using (SystemX509Store store = SystemX509Store.OpenAnchor())
     {
         UniformCertificateResolver anchors = new UniformCertificateResolver(store.GetAllCertificates());
         return(new TrustAnchorResolver(anchors));
     }
 }
Exemplo n.º 2
0
        /*
         *  These methods work with the default Direct Project Certificate Stores
         */

        /// <summary>
        /// Creates the default Direct Project machine stores if they don't already exist
        /// </summary>
        public static void CreateAll()
        {
            SystemX509Store store;

            store = SystemX509Store.OpenAnchorEdit();
            store.Dispose();

            store = SystemX509Store.OpenExternalEdit();
            store.Dispose();

            store = SystemX509Store.OpenPrivateEdit();
            store.Dispose();
        }
Exemplo 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});
        }