Exemplo n.º 1
0
        public CryptographerTests()
        {
            m_tester        = AgentTester.CreateTest();
            m_cryptographer = m_tester.AgentA.Cryptographer;
            MemoryX509Store certs = AgentTester.LoadPrivateCerts("redmond");

            m_cert = certs.First();
        }
Exemplo n.º 2
0
        public CryptographerTests()
        {
            m_tester        = AgentTester.CreateTest();
            m_cryptographer = m_tester.AgentA.Cryptographer as SMIMECryptographer;

            MemoryX509Store certs = AgentTester.LoadPrivateCerts("redmond");

            m_cert = certs
                     .ToList()
                     .First(c => c.HasPrivateKey);
        }
Exemplo n.º 3
0
        public void TestSigned()
        {
            X509Certificate2           signingCert = AgentTester.LoadPrivateCerts("redmond").First();
            X509Certificate2Collection certs       = AgentTester.LoadPrivateCerts("nhind").GetAllCertificates();

            byte[] p7sData = null;
            Assert.DoesNotThrow(() => p7sData = AnchorBundle.CreateSigned(certs, signingCert));
            Assert.True(!p7sData.IsNullOrEmpty());

            AnchorBundle bundle = null;

            Assert.DoesNotThrow(() => bundle = new AnchorBundle(p7sData, true));
            Assert.True(!bundle.Certificates.IsNullOrEmpty());
            Assert.True(certs.Count == bundle.Certificates.Count);
        }