public static bool CheckCertificateWithWithCaCertificate(Certificate certificate, Certificate caCertificate)
        {
            if (!CertificateSignatureValidator.ValidateCertificateSignature(certificate, caCertificate))
            {
                Logger.log("Can not find validate signature with issuer certificate");
                return(false);
            }

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

            if (!CheckCertificatePolicyWithCaCertificate(certificate, caCertificate))
            {
                return(false);
            }

            return(true);
        }
        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);
        }