List<SecurityEvent> requestSecurityEvents = outputProcessorChain.getSecurityContext().getAsList(SecurityEvent.class);
for (int i = 0; i < requestSecurityEvents.size(); i++) {
SecurityEvent securityEvent = requestSecurityEvents.get(i);
if (SecurityEventConstants.SignatureValue.equals(securityEvent.getSecurityEventType())) {
aSignatureFound = true;
SignatureValueSecurityEvent signatureValueSecurityEvent = (SignatureValueSecurityEvent) securityEvent;
WSSUtils.updateSecurityHeaderOrder(outputProcessorChain, headerElementName, getAction(), false);
List<XMLSecAttribute> attributes = new ArrayList<XMLSecAttribute>(2);
attributes.add(createAttribute(WSSConstants.ATT_wsu_Id, IDGenerator.generateID(null)));
attributes.add(createAttribute(WSSConstants.ATT_NULL_Value, new Base64(76, new byte[]{'\n'}).encodeToString(signatureValueSecurityEvent.getSignatureValue())));
createStartElementAndOutputAsEvent(subOutputProcessorChain, headerElementName, true, attributes);
createEndElementAndOutputAsEvent(subOutputProcessorChain, headerElementName);
}
}