Esempio n. 1
0
        public void IsCertificateValid_OnNullCert_ShouldReturnFalse()
        {
            var certificateValidator = new CertificateValidator(
                new LetsEncryptOptions(),
                new NullLogger <CertificateValidator>());

            certificateValidator.IsCertificateValid(null).Should().BeFalse();
        }
Esempio n. 2
0
        public void ValidateCertificateTests(CertificateDates cd, ValidatorSettings vs, bool expected)
        {
            var certificateValidator = new CertificateValidator(
                new LetsEncryptOptions
            {
                TimeUntilExpiryBeforeRenewal    = vs.TimeUntilExpiryBeforeRenewal,
                TimeAfterIssueDateBeforeRenewal = vs.TimeAfterIssueDateBeforeRenewal
            },
                new NullLogger <CertificateValidator>());

            var cert = SelfSignedCertificate.Make(cd.From, cd.To);

            certificateValidator.IsCertificateValid(cert).Should().Be(expected);
        }
        public bool IsCertificateValid(X509Certificate2 cert)
        {
            var errors = string.Empty;

            return(CertificateValidator.IsCertificateValid(cert, rootCertificateTumbprint, out errors));
        }