Exemplo n.º 1
0
        public void ValidatesCertificateThumbprintBySha256()
        {
            var certificate = new X509Certificate2(Encoding.ASCII.GetBytes(TestCertificateHelper.CertificatePem));
            var thumbprints = new[] { "1826331953f481879eec6730c565e8849360a9d3b9d230071da29e3fe9751071", TestCertificateHelper.CertificateThumbprintSha256 };

            Assert.True(CertificateHelper.ValidateCertificateThumbprint(certificate, thumbprints));
        }
Exemplo n.º 2
0
        public void InvalidatesCertificateThumbprintBySha256()
        {
            var certificate = new X509Certificate2(Encoding.ASCII.GetBytes(TestCertificateHelper.CertificatePem));
            var thumbprints = new[] { "abcdef1953f481879eec6730c565e8849360a9d3b9d230071da29e3fe9751071", "1234567893f481879eec6730c565e8849360a9d3b9d230071da29e3fe9751071" };

            Assert.False(CertificateHelper.ValidateCertificateThumbprint(certificate, thumbprints));
        }
Exemplo n.º 3
0
        public void InvalidatesCertificateThumbprintBySha1()
        {
            var certificate = new X509Certificate2(Encoding.ASCII.GetBytes(TestCertificateHelper.CertificatePem));
            var thumbprints = new[] { "abcdeae53da1f86112acb008cac657b8dd259e76", "1234567890a1f86112acb008cac657b8dd259e76" };

            Assert.False(CertificateHelper.ValidateCertificateThumbprint(certificate, thumbprints));
        }