el = DOMUtils.getNextElement(el);
}
writer.writeStartElement(prefix, "RequestedSecurityToken", namespace);
SecurityContextToken sct =
new SecurityContextToken(SecureConversationTokenInterceptorProvider
.getWSCVersion(tokenType), writer.getDocument());
Calendar created = Calendar.getInstance();
Calendar expires = Calendar.getInstance();
expires.setTimeInMillis(System.currentTimeMillis() + ttl);
SecurityToken token = new SecurityToken(sct.getIdentifier(), created, expires);
token.setToken(sct.getElement());
token.setTokenType(WSConstants.WSC_SCT);
writer.getCurrentNode().appendChild(sct.getElement());
writer.writeEndElement();
writer.writeStartElement(prefix, "RequestedAttachedReference", namespace);
token.setAttachedReference(SecureConversationTokenInterceptorProvider
.writeSecurityTokenReference(writer,
"#" + sct.getID(),
tokenType));
writer.writeEndElement();
writer.writeStartElement(prefix, "RequestedUnattachedReference", namespace);
token.setUnattachedReference(SecureConversationTokenInterceptorProvider
.writeSecurityTokenReference(writer,
sct.getIdentifier(),
tokenType));
writer.writeEndElement();
XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
writer.writeStartElement(prefix, "Lifetime", namespace);