throws XMLSecurityException {
//fire a SecurityEvent:
final DocumentContext documentContext = inputProcessorChain.getDocumentContext();
if (elementPath.size() == 3 && WSSUtils.isInSOAPHeader(elementPath)
|| elementPath.size() == 2 && WSSUtils.isInSOAPBody(elementPath)) {
SignedPartSecurityEvent signedPartSecurityEvent =
new SignedPartSecurityEvent(getInboundSecurityToken(), true, documentContext.getProtectionOrder());
signedPartSecurityEvent.setElementPath(elementPath);
signedPartSecurityEvent.setXmlSecEvent(xmlSecEvent);
signedPartSecurityEvent.setCorrelationID(referenceType.getId());
inputProcessorChain.getSecurityContext().registerSecurityEvent(signedPartSecurityEvent);
} else {
SignedElementSecurityEvent signedElementSecurityEvent =
new SignedElementSecurityEvent(getInboundSecurityToken(), true, documentContext.getProtectionOrder());
signedElementSecurityEvent.setElementPath(elementPath);