Class AbstractDecryptInputProcessor
java.lang.Object
org.apache.xml.security.stax.ext.AbstractInputProcessor
org.apache.xml.security.stax.impl.processor.input.AbstractDecryptInputProcessor
- All Implemented Interfaces:
InputProcessor
- Direct Known Subclasses:
XMLDecryptInputProcessor
Processor for decryption of EncryptedData XML structures
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
The DecryptedEventReaderInputProcessor reads the decrypted stream with a StAX reader and forwards the generated XMLEvents(package private) static class
The DecryptionThread handles encrypted XML-Parts -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final KeyInfoType
private static final org.slf4j.Logger
protected static final Integer
protected static final Integer
private final List
<ReferenceType> private final Map
<String, ReferenceType> private final ArrayDeque
<XMLSecEvent> private final String
private final QName
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDecryptInputProcessor
(KeyInfoType keyInfoType, ReferenceList referenceList, XMLSecurityProperties securityProperties) AbstractDecryptInputProcessor
(XMLSecurityProperties securityProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStream
applyTransforms
(ReferenceType referenceType, InputStream inputStream) void
doFinal
(InputProcessorChain inputProcessorChain) Will be called when the whole document is processed.private void
forwardToWrapperElement
(XMLStreamReader xmlStreamReader) private Cipher
private InboundSecurityToken
getSecurityToken
(InputProcessorChain inputProcessorChain, XMLSecStartElement xmlSecStartElement, EncryptedDataType encryptedDataType) protected abstract void
handleCipherReference
(InputProcessorChain inputProcessorChain, EncryptedDataType encryptedDataType, Cipher cipher, InboundSecurityToken inboundSecurityToken) protected abstract void
handleEncryptedContent
(InputProcessorChain inputProcessorChain, XMLSecStartElement parentXMLSecStartElement, InboundSecurityToken inboundSecurityToken, EncryptedDataType encryptedDataType) protected abstract void
handleSecurityToken
(InboundSecurityToken inboundSecurityToken, InboundSecurityContext inboundSecurityContext, EncryptedDataType encryptedDataType) protected abstract InputStream
handleXOPInclude
(InputProcessorChain inputProcessorChain, EncryptedDataType encryptedDataType, String href, Cipher cipher, InboundSecurityToken inboundSecurityToken) protected ReferenceType
matchesReferenceId
(XMLSecStartElement xmlSecStartElement) protected abstract AbstractDecryptInputProcessor.AbstractDecryptedEventReaderInputProcessor
newDecryptedEventReaderInputProcessor
(boolean encryptedHeader, XMLSecStartElement xmlSecStartElement, EncryptedDataType currentEncryptedDataType, InboundSecurityToken inboundSecurityToken, InboundSecurityContext inboundSecurityContext) private EncryptedDataType
parseEncryptedDataStructure
(boolean isSecurityHeaderEvent, XMLSecEvent xmlSecEvent, InputProcessorChain subInputProcessorChain) private XMLSecEvent
processEvent
(InputProcessorChain inputProcessorChain, boolean isSecurityHeaderEvent) processNextEvent
(InputProcessorChain inputProcessorChain) Will be called from the framework when the next XMLEvent is requestedprocessNextHeaderEvent
(InputProcessorChain inputProcessorChain) Will be called from the framework when the next security-header XMLEvent is requestedprivate XMLSecEvent
readAndBufferEncryptedHeader
(InputProcessorChain inputProcessorChain, boolean isSecurityHeaderEvent, XMLSecEvent xmlSecEvent) private InputStream
private InputStream
writeWrapperStartElement
(XMLSecStartElement xmlSecStartElement) Methods inherited from class org.apache.xml.security.stax.ext.AbstractInputProcessor
addAfterProcessor, addBeforeProcessor, getAfterProcessors, getBeforeProcessors, getPhase, getReferenceIDAttribute, getSecurityProperties, setPhase
-
Field Details
-
LOG
private static final transient org.slf4j.Logger LOG -
maximumAllowedXMLStructureDepth
-
maximumAllowedEncryptedDataEvents
-
keyInfoType
-
references
-
processedReferences
-
uuid
-
wrapperElementName
-
tmpXmlEventList
-
-
Constructor Details
-
AbstractDecryptInputProcessor
public AbstractDecryptInputProcessor(XMLSecurityProperties securityProperties) throws XMLSecurityException - Throws:
XMLSecurityException
-
AbstractDecryptInputProcessor
public AbstractDecryptInputProcessor(KeyInfoType keyInfoType, ReferenceList referenceList, XMLSecurityProperties securityProperties) throws XMLSecurityException - Throws:
XMLSecurityException
-
-
Method Details
-
getReferences
-
getProcessedReferences
-
processNextHeaderEvent
public XMLSecEvent processNextHeaderEvent(InputProcessorChain inputProcessorChain) throws 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
- Parameters:
inputProcessorChain
-- Returns:
- The next XMLSecEvent
- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
processNextEvent
public XMLSecEvent processNextEvent(InputProcessorChain inputProcessorChain) throws 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
- Parameters:
inputProcessorChain
-- Returns:
- The next XMLSecEvent
- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
processEvent
private XMLSecEvent processEvent(InputProcessorChain inputProcessorChain, boolean isSecurityHeaderEvent) throws XMLStreamException, XMLSecurityException -
applyTransforms
protected InputStream applyTransforms(ReferenceType referenceType, InputStream inputStream) throws XMLSecurityException - Throws:
XMLSecurityException
-
writeWrapperStartElement
private InputStream writeWrapperStartElement(XMLSecStartElement xmlSecStartElement) throws IOException - Throws:
IOException
-
writeWrapperEndElement
- Throws:
IOException
-
forwardToWrapperElement
- Throws:
XMLStreamException
-
getCipher
- Throws:
XMLSecurityException
-
getSecurityToken
private InboundSecurityToken getSecurityToken(InputProcessorChain inputProcessorChain, XMLSecStartElement xmlSecStartElement, EncryptedDataType encryptedDataType) throws XMLSecurityException - Throws:
XMLSecurityException
-
parseEncryptedDataStructure
private EncryptedDataType parseEncryptedDataStructure(boolean isSecurityHeaderEvent, XMLSecEvent xmlSecEvent, InputProcessorChain subInputProcessorChain) throws XMLStreamException, XMLSecurityException -
readAndBufferEncryptedHeader
private XMLSecEvent readAndBufferEncryptedHeader(InputProcessorChain inputProcessorChain, boolean isSecurityHeaderEvent, XMLSecEvent xmlSecEvent) throws XMLStreamException, XMLSecurityException -
newDecryptedEventReaderInputProcessor
protected abstract AbstractDecryptInputProcessor.AbstractDecryptedEventReaderInputProcessor newDecryptedEventReaderInputProcessor(boolean encryptedHeader, XMLSecStartElement xmlSecStartElement, EncryptedDataType currentEncryptedDataType, InboundSecurityToken inboundSecurityToken, InboundSecurityContext inboundSecurityContext) throws XMLSecurityException - Throws:
XMLSecurityException
-
handleSecurityToken
protected abstract void handleSecurityToken(InboundSecurityToken inboundSecurityToken, InboundSecurityContext inboundSecurityContext, EncryptedDataType encryptedDataType) throws XMLSecurityException - Throws:
XMLSecurityException
-
handleEncryptedContent
protected abstract void handleEncryptedContent(InputProcessorChain inputProcessorChain, XMLSecStartElement parentXMLSecStartElement, InboundSecurityToken inboundSecurityToken, EncryptedDataType encryptedDataType) throws XMLSecurityException - Throws:
XMLSecurityException
-
handleCipherReference
protected abstract void handleCipherReference(InputProcessorChain inputProcessorChain, EncryptedDataType encryptedDataType, Cipher cipher, InboundSecurityToken inboundSecurityToken) throws XMLSecurityException - Throws:
XMLSecurityException
-
handleXOPInclude
protected abstract InputStream handleXOPInclude(InputProcessorChain inputProcessorChain, EncryptedDataType encryptedDataType, String href, Cipher cipher, InboundSecurityToken inboundSecurityToken) throws XMLSecurityException - Throws:
XMLSecurityException
-
matchesReferenceId
-
doFinal
public void doFinal(InputProcessorChain inputProcessorChain) throws 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
- Parameters:
inputProcessorChain
-- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-