Ejemplo n.º 1
0
        private static bool ValidateRevokeSubCaCertificateRequestSignature(Certificate subCACertificate,
                                                                           byte[] signature)
        {
            Logger.log("Starting Validate Revoke SubCA Certificate Request Signature");
            Logger.log("Request Signature");
            Logger.log(signature);
            Logger.log("Checking Revoke SubCA Certificate Request Signature with SubCA Certificate Public Key");
            bool verified =
                SignatureValidator.CheckRevokeSubCACertificateRequestSignature(signature, subCACertificate,
                                                                               subCACertificate);

            if (verified)
            {
                Logger.log("Verified Revoke SubCA Certificate Request Signature with SubCA Certificate Public Key");
                return(true);
            }

            Certificate issuerCACertificate = CertificateChainValidator.FindIssuerCaCertificate(subCACertificate);

            if (!issuerCACertificate.IsLoaded)
            {
                Logger.log("Can not find issuer certificate, so returning signature verification failed");
                return(false);
            }

            verified = SignatureValidator.CheckRevokeSubCACertificateRequestSignature(signature, subCACertificate,
                                                                                      issuerCACertificate);
            if (verified)
            {
                Logger.log(
                    "Verified Revoke SubCA Certificate Request Signature with SubCA Certificate Issuer Public Key");
                return(true);
            }

            Logger.log("Finished Validate Revoke SubCA Certificate Request Signature. Result :", verified);
            return(verified);
        }