コード例 #1
0
        public void ReadTest()
        {
            Dictionary <string, X509Certificate2> certs = new Dictionary <string, X509Certificate2>();
            string crlfpath = Path.GetFullPath("CABundle-CRLF.txt");

            CABundle.Read(crlfpath, certs);
            Assert.IsTrue(certs.Count == 2, "Did not read 2 certs from CRLF bundle");

            certs.Clear();
            string lfpath = Path.GetFullPath("CABundle-LF.txt");

            CABundle.Read(lfpath, certs);
            Assert.IsTrue(certs.Count == 2, "Did not read 2 certs from LF bundle");
        }
コード例 #2
0
        public void WriteTest()
        {
            Dictionary <string, X509Certificate2> certs = new Dictionary <string, X509Certificate2>();
            string crlfpath = Path.GetFullPath("CABundle-CRLF.txt");

            CABundle.Read(crlfpath, certs);

            string newpath   = Directory.GetParent(crlfpath).FullName;
            string newbundle = Path.Combine(newpath, "CABundle-new.txt");

            CABundle.Write(newbundle, certs);

            certs.Clear();
            CABundle.Read(newbundle, certs);
            Assert.IsTrue(certs.Count == 2, "Did not read 2 certs from new bundle");
        }