Exemplo n.º 1
0
        public static bool ValidateCertificateSignatureWithChain(Certificate certificate)
        {
            Certificate caCertificate = FindIssuerCaCertificate(certificate);

            if (!caCertificate.IsLoaded)
            {
                return(false);
            }

            if (!CertificateSignatureValidator.ValidateCertificateSignature(certificate, caCertificate))
            {
                return(false);
            }

            if (!CertificateValidator.CheckValidityPeriodWithCaCertificate(certificate, caCertificate))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
        public static bool ValidateRootCaCertificate(Certificate rootCaCertificate)
        {
            if (!CertificateFieldValidator.Validate(rootCaCertificate))
            {
                return(false);
            }

            if (!CertificateSignatureValidator.ValidateSelfSignedCertificateSignature(rootCaCertificate))
            {
                return(false);
            }

            if (!CheckValidityPeriod(rootCaCertificate))
            {
                return(false);
            }

            if (!ValidateRootCaCertificateFields(rootCaCertificate))
            {
                return(false);
            }

            return(true);
        }