engageSecurityHeaderHandler(subInputProcessorChain, getSecurityProperties(),
xmlSecEventList, startIndexForProcessor, xmlSecStartElement.getName());
}
break;
case XMLStreamConstants.END_ELEMENT:
XMLSecEndElement xmlSecEndElement = xmlSecEvent.asEndElement();
documentLevel = xmlSecEndElement.getDocumentLevel();
if (documentLevel == 3 && responsibleSecurityHeaderFound
&& xmlSecEndElement.getName().equals(WSSConstants.TAG_wsse_Security)) {
return finalizeHeaderProcessing(
inputProcessorChain, subInputProcessorChain,
internalSecurityHeaderBufferProcessor, xmlSecEventList);
} else if (documentLevel == 4 && responsibleSecurityHeaderFound
&& WSSUtils.isInSecurityHeader(xmlSecEndElement,
((WSSSecurityProperties) getSecurityProperties()).getActor())) {
//we are in the security header and the depth is +1, so every child
//element should have a responsible handler with the exception of an EncryptedData SecurityHeader
//which is already handled in the above StartElement logic (@see comment above).
if (!WSSConstants.TAG_xenc_EncryptedData.equals(xmlSecEndElement.getName())) {
engageSecurityHeaderHandler(subInputProcessorChain, getSecurityProperties(),
xmlSecEventList, startIndexForProcessor, xmlSecEndElement.getName());
}
// Check for multiple timestamps
if (xmlSecEndElement.getName().equals(WSSConstants.TAG_wsu_Timestamp)) {
if (timestampFound) {
WSInboundSecurityContext context =
(WSInboundSecurityContext)subInputProcessorChain.getSecurityContext();
context.handleBSPRule(BSPRule.R3227);
}