Class DefaultXMLMessageSignatureValidator

java.lang.Object
se.idsec.signservice.security.sign.xml.impl.DefaultXMLMessageSignatureValidator
All Implemented Interfaces:
XMLMessageSignatureValidator

public class DefaultXMLMessageSignatureValidator extends Object implements XMLMessageSignatureValidator
Implementation of the XMLMessageSignatureValidator interface.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • DefaultXMLMessageSignatureValidator

      public DefaultXMLMessageSignatureValidator()
      Default constructor.
  • Method Details

    • validate

      public void validate(Document document, List<X509Certificate> expectedSignerCertificates, XMLSignatureLocation signatureLocation) throws SignatureException
      Validates the signature on the supplied XML document and asserts that it was signed by any of the supplied certificates.

      If expectedSignerCertificates is null or empty no checking of the signer certificate will be performed.

      If signatureLocation is null and the document contains more than one Signature element the validation will fail.

      Specified by:
      validate in interface XMLMessageSignatureValidator
      Parameters:
      document - the XML document to validate
      expectedSignerCertificates - the expected signer certificates
      signatureLocation - the signature location
      Throws:
      SignatureException - for validation errors