code: public void validateSignature(MetadataServiceList mdsl, X509Certificate signersCertificate) throws SignatureException {
  
      // The signature to validate.
      //
      final Signature signature = mdsl.getSignature();
      if (signature == null) {
        log.warn("Metadata service list is not signed");
        throw new SignatureException("Metadata service list has no signature");
      }
  
      // Is the signature correct according to the SAML signature profile?
      //
      try {
        this.signatureProfileValidator.validate(signature);
      }
      catch (SignatureException e) {
        log.warn("Signature failed pre-validation: " + e.getMessage());
        throw e;
      }
  
      // Validate the signature.
      //
      CriteriaSet criteria = new CriteriaSet(new X509CertificateCriterion(signersCertificate));
      try {
        if (!this.signatureTrustEngine.validate(signature, criteria)) {
          String msg = "Signature validation failed";
          log.warn(msg);
          throw new SignatureException(msg);
        }
      }
      catch (SecurityException e) {
        String msg = String.format("A problem was encountered evaluating the signature: %s", e.getMessage());
        log.warn(msg);
        throw new SignatureException(msg, e);
      }
  
      log.debug("Signature on MetadataServiceList successfully verified");
    }
docs: Validates the signature of the supplied {@code MetadataServiceList} element using the supplied certificate.
  
  @param mdsl
  the {@code MetadataServiceList}
  @param signersCertificate
  the certificate of the signer
  @throws SignatureException
  for validation errors