コード例 #1
0
        public void ServiceModelLoadResourceCertificates()
        {
            using (X509CertificateLoader loader = new X509CertificateLoader(GetType(), "Tasty.Test.TastyClient.cer"))
            {
                Assert.IsNotNull(loader.LoadCertificate());
            }

            using (X509CertificateLoader loader = new X509CertificateLoader(GetType(), "Tasty.Test.TastyClient.pfx", "tastyclient"))
            {
                Assert.IsNotNull(loader.LoadCertificate());
            }

            using (X509CertificateLoader loader = new X509CertificateLoader(GetType(), "Tasty.Test.TastyServer.pfx", "tastyserver"))
            {
                Assert.IsNotNull(loader.LoadCertificate());
            }
        }
コード例 #2
0
        public void ServiceModelLoadFileSystemCertificates()
        {
            using (X509CertificateLoader loader = new X509CertificateLoader(Path.GetFullPath("TastyClient.cer")))
            {
                Assert.IsNotNull(loader.LoadCertificate());
            }

            using (X509CertificateLoader loader = new X509CertificateLoader(Path.GetFullPath("TastyClient.pfx"), "tastyclient"))
            {
                Assert.IsNotNull(loader.LoadCertificate());
            }

            using (X509CertificateLoader loader = new X509CertificateLoader(Path.GetFullPath("TastyServer.pfx"), "tastyserver"))
            {
                Assert.IsNotNull(loader.LoadCertificate());
            }
        }