org.apache.camel.component.xmlsecurity.api
Class DefaultValidationFailedHandler

java.lang.Object
  extended by org.apache.camel.component.xmlsecurity.api.DefaultValidationFailedHandler
All Implemented Interfaces:
ValidationFailedHandler

public class DefaultValidationFailedHandler
extends Object
implements ValidationFailedHandler

Interrupts the validation by throwing an exception as soon as a validation failure occurs and gives specific error messages.


Constructor Summary
DefaultValidationFailedHandler()
           
 
Method Summary
 void end()
           
 boolean ignoreCoreValidationFailure()
          If true is returned then the verifier will go-on as if there was no validation failure.
 void manifestReferenceValidationFailed(Reference ref)
           
 Exception onXMLSignatureException(XMLSignatureException se)
          Method called when an XMLSignatureException is thrown by the method XMLSignature.validate(javax.xml.crypto.dsig.XMLValidateContext).
 void referenceValidationFailed(Reference ref)
           
 void signatureValueValidationFailed(XMLSignature.SignatureValue value)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultValidationFailedHandler

public DefaultValidationFailedHandler()
Method Detail

onXMLSignatureException

public Exception onXMLSignatureException(XMLSignatureException se)
Description copied from interface: ValidationFailedHandler
Method called when an XMLSignatureException is thrown by the method XMLSignature.validate(javax.xml.crypto.dsig.XMLValidateContext).

You can return more specific exceptions which are useful for your use-case.

Specified by:
onXMLSignatureException in interface ValidationFailedHandler
Parameters:
se - exception
Returns:
exception exception which is then thrown by XmlSignerProcessor.

start

public void start()
Specified by:
start in interface ValidationFailedHandler

signatureValueValidationFailed

public void signatureValueValidationFailed(XMLSignature.SignatureValue value)
                                    throws Exception
Specified by:
signatureValueValidationFailed in interface ValidationFailedHandler
Throws:
Exception

referenceValidationFailed

public void referenceValidationFailed(Reference ref)
                               throws Exception
Specified by:
referenceValidationFailed in interface ValidationFailedHandler
Throws:
Exception

manifestReferenceValidationFailed

public void manifestReferenceValidationFailed(Reference ref)
                                       throws Exception
Specified by:
manifestReferenceValidationFailed in interface ValidationFailedHandler
Throws:
Exception

end

public void end()
         throws Exception
Specified by:
end in interface ValidationFailedHandler
Throws:
Exception

ignoreCoreValidationFailure

public boolean ignoreCoreValidationFailure()
                                    throws Exception
Description copied from interface: ValidationFailedHandler
If true is returned then the verifier will go-on as if there was no validation failure. If false is returned than the verifier will throw an XmlSignatureInvalidException.

Best practice is to return false to ensure that after a core validation failure, the verification fails.

Specified by:
ignoreCoreValidationFailure in interface ValidationFailedHandler
Returns:
true or false
Throws:
Exception


Apache Camel