protected WSSecTimestamp handleLayout(WSSecTimestamp timestamp) {
Collection<AssertionInfo> ais;
ais = aim.get(SP12Constants.LAYOUT);
if (ais != null) {
for (AssertionInfo ai : ais) {
Layout layout = (Layout)ai.getAssertion();
ai.setAsserted(true);
if (SPConstants.Layout.LaxTimestampLast == layout.getValue()) {
if (timestamp == null) {
ai.setNotAsserted(SPConstants.Layout.LaxTimestampLast + " requires a timestamp");
} else {
ai.setAsserted(true);
Element el = timestamp.getElement();
secHeader.getSecurityHeader().appendChild(el);
if (bottomUpElement == null) {
bottomUpElement = el;
}
}
} else if (SPConstants.Layout.LaxTimestampFirst == layout.getValue()) {
if (timestamp == null) {
ai.setNotAsserted(SPConstants.Layout.LaxTimestampLast + " requires a timestamp");
} else {
addTopDownElement(timestampEl.getElement());
}