Class AbstractSignatureReferenceVerifyInputProcessor
- java.lang.Object
-
- org.apache.xml.security.stax.ext.AbstractInputProcessor
-
- org.apache.xml.security.stax.impl.processor.input.AbstractSignatureReferenceVerifyInputProcessor
-
- All Implemented Interfaces:
InputProcessor
- Direct Known Subclasses:
XMLSignatureReferenceVerifyInputProcessor
public abstract class AbstractSignatureReferenceVerifyInputProcessor extends AbstractInputProcessor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AbstractSignatureReferenceVerifyInputProcessor.InternalSignatureReferenceVerifier
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.Boolean
allowNotSameDocumentReferences
protected static java.lang.Boolean
doNotThrowExceptionForManifests
private java.util.List<KeyValue<ResourceResolver,ReferenceType>>
externalReferences
private InboundSecurityToken
inboundSecurityToken
private static org.slf4j.Logger
LOG
protected static java.lang.Integer
maximumAllowedReferencesPerManifest
protected static java.lang.Integer
maximumAllowedTransformsPerReference
private java.util.List<ReferenceType>
processedReferences
private java.util.List<KeyValue<ResourceResolver,ReferenceType>>
sameDocumentReferences
private SignatureType
signatureType
-
Constructor Summary
Constructors Constructor Description AbstractSignatureReferenceVerifyInputProcessor(InputProcessorChain inputProcessorChain, SignatureType signatureType, InboundSecurityToken inboundSecurityToken, XMLSecurityProperties securityProperties)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Transformer
buildTransformerChain(ReferenceType referenceType, java.io.OutputStream outputStream, InputProcessorChain inputProcessorChain, AbstractSignatureReferenceVerifyInputProcessor.InternalSignatureReferenceVerifier internalSignatureReferenceVerifier)
protected void
compareDigest(byte[] calculatedDigest, ReferenceType referenceType)
protected DigestOutputStream
createMessageDigestOutputStream(ReferenceType referenceType, InboundSecurityContext inboundSecurityContext)
void
doFinal(InputProcessorChain inputProcessorChain)
Will be called when the whole document is processed.InboundSecurityToken
getInboundSecurityToken()
java.util.List<ReferenceType>
getProcessedReferences()
protected AbstractSignatureReferenceVerifyInputProcessor.InternalSignatureReferenceVerifier
getSignatureReferenceVerifier(XMLSecurityProperties securityProperties, InputProcessorChain inputProcessorChain, ReferenceType referenceType, XMLSecStartElement startElement)
SignatureType
getSignatureType()
protected abstract void
processElementPath(java.util.List<javax.xml.namespace.QName> elementPath, InputProcessorChain inputProcessorChain, XMLSecEvent xmlSecEvent, ReferenceType referenceType)
XMLSecEvent
processNextEvent(InputProcessorChain inputProcessorChain)
Will be called from the framework when the next XMLEvent is requestedXMLSecEvent
processNextHeaderEvent(InputProcessorChain inputProcessorChain)
Will be called from the framework when the next security-header XMLEvent is requestedprotected java.util.List<ReferenceType>
resolvesResource(XMLSecStartElement xmlSecStartElement)
protected void
verifyExternalReference(InputProcessorChain inputProcessorChain, java.io.InputStream inputStream, ReferenceType referenceType)
-
Methods inherited from class org.apache.xml.security.stax.ext.AbstractInputProcessor
addAfterProcessor, addBeforeProcessor, getAfterProcessors, getBeforeProcessors, getPhase, getReferenceIDAttribute, getSecurityProperties, setPhase
-
-
-
-
Field Detail
-
LOG
private static final transient org.slf4j.Logger LOG
-
maximumAllowedReferencesPerManifest
protected static final java.lang.Integer maximumAllowedReferencesPerManifest
-
maximumAllowedTransformsPerReference
protected static final java.lang.Integer maximumAllowedTransformsPerReference
-
doNotThrowExceptionForManifests
protected static final java.lang.Boolean doNotThrowExceptionForManifests
-
allowNotSameDocumentReferences
protected static final java.lang.Boolean allowNotSameDocumentReferences
-
signatureType
private final SignatureType signatureType
-
inboundSecurityToken
private final InboundSecurityToken inboundSecurityToken
-
sameDocumentReferences
private final java.util.List<KeyValue<ResourceResolver,ReferenceType>> sameDocumentReferences
-
externalReferences
private final java.util.List<KeyValue<ResourceResolver,ReferenceType>> externalReferences
-
processedReferences
private final java.util.List<ReferenceType> processedReferences
-
-
Constructor Detail
-
AbstractSignatureReferenceVerifyInputProcessor
public AbstractSignatureReferenceVerifyInputProcessor(InputProcessorChain inputProcessorChain, SignatureType signatureType, InboundSecurityToken inboundSecurityToken, XMLSecurityProperties securityProperties) throws XMLSecurityException
- Throws:
XMLSecurityException
-
-
Method Detail
-
getSignatureType
public SignatureType getSignatureType()
-
getProcessedReferences
public java.util.List<ReferenceType> getProcessedReferences()
-
getInboundSecurityToken
public InboundSecurityToken getInboundSecurityToken()
-
processNextHeaderEvent
public XMLSecEvent processNextHeaderEvent(InputProcessorChain inputProcessorChain) throws javax.xml.stream.XMLStreamException, XMLSecurityException
Description copied from interface:InputProcessor
Will be called from the framework when the next security-header XMLEvent is requested- Specified by:
processNextHeaderEvent
in interfaceInputProcessor
- Specified by:
processNextHeaderEvent
in classAbstractInputProcessor
- Returns:
- The next XMLSecEvent
- Throws:
javax.xml.stream.XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
processNextEvent
public XMLSecEvent processNextEvent(InputProcessorChain inputProcessorChain) throws javax.xml.stream.XMLStreamException, XMLSecurityException
Description copied from interface:InputProcessor
Will be called from the framework when the next XMLEvent is requested- Specified by:
processNextEvent
in interfaceInputProcessor
- Specified by:
processNextEvent
in classAbstractInputProcessor
- Returns:
- The next XMLSecEvent
- Throws:
javax.xml.stream.XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
processElementPath
protected abstract void processElementPath(java.util.List<javax.xml.namespace.QName> elementPath, InputProcessorChain inputProcessorChain, XMLSecEvent xmlSecEvent, ReferenceType referenceType) throws XMLSecurityException
- Throws:
XMLSecurityException
-
resolvesResource
protected java.util.List<ReferenceType> resolvesResource(XMLSecStartElement xmlSecStartElement)
-
doFinal
public void doFinal(InputProcessorChain inputProcessorChain) throws javax.xml.stream.XMLStreamException, XMLSecurityException
Description copied from interface:InputProcessor
Will be called when the whole document is processed.- Specified by:
doFinal
in interfaceInputProcessor
- Overrides:
doFinal
in classAbstractInputProcessor
- Throws:
javax.xml.stream.XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
getSignatureReferenceVerifier
protected AbstractSignatureReferenceVerifyInputProcessor.InternalSignatureReferenceVerifier getSignatureReferenceVerifier(XMLSecurityProperties securityProperties, InputProcessorChain inputProcessorChain, ReferenceType referenceType, XMLSecStartElement startElement) throws XMLSecurityException
- Throws:
XMLSecurityException
-
verifyExternalReference
protected void verifyExternalReference(InputProcessorChain inputProcessorChain, java.io.InputStream inputStream, ReferenceType referenceType) throws XMLSecurityException, javax.xml.stream.XMLStreamException
- Throws:
XMLSecurityException
javax.xml.stream.XMLStreamException
-
createMessageDigestOutputStream
protected DigestOutputStream createMessageDigestOutputStream(ReferenceType referenceType, InboundSecurityContext inboundSecurityContext) throws XMLSecurityException
- Throws:
XMLSecurityException
-
buildTransformerChain
protected Transformer buildTransformerChain(ReferenceType referenceType, java.io.OutputStream outputStream, InputProcessorChain inputProcessorChain, AbstractSignatureReferenceVerifyInputProcessor.InternalSignatureReferenceVerifier internalSignatureReferenceVerifier) throws XMLSecurityException
- Throws:
XMLSecurityException
-
compareDigest
protected void compareDigest(byte[] calculatedDigest, ReferenceType referenceType) throws XMLSecurityException
- Throws:
XMLSecurityException
-
-