Exemple #1
0
        public void GetServerCertificateAndChainFromFileRaisesArgExceptionWithInvalidPrivateKeyFile()
        {
            string testFile = Path.GetRandomFileName();

            Assert.Throws <ArgumentException>(() => CertificateHelper.GetServerCertificateAndChainFromFile(testFile, null));
            Assert.Throws <ArgumentException>(() => CertificateHelper.GetServerCertificateAndChainFromFile(testFile, string.Empty));
            Assert.Throws <ArgumentException>(() => CertificateHelper.GetServerCertificateAndChainFromFile(testFile, "   "));
        }
Exemple #2
0
        public void GetServerCertificateAndChainFromFileRaisesArgExceptionWithInvalidCertFile()
        {
            string testFile = Path.GetRandomFileName();

            Assert.Throws <ArgumentException>(() => CertificateHelper.GetServerCertificateAndChainFromFile(null, testFile));
            Assert.Throws <ArgumentException>(() => CertificateHelper.GetServerCertificateAndChainFromFile(string.Empty, testFile));
            Assert.Throws <ArgumentException>(() => CertificateHelper.GetServerCertificateAndChainFromFile("   ", testFile));
        }