/** * Constructor to create the SCT * * @param doc */ public SecurityContextToken(int version, Document doc) throws ConversationException { String ns = ConversationConstants.getWSCNs(version); element = doc.createElementNS(ns, "wsc:" + ConversationConstants.SECURITY_CONTEXT_TOKEN_LN); WSSecurityUtil.setNamespace(element, ns, ConversationConstants.WSC_PREFIX); elementIdentifier = doc.createElementNS(ns, "wsc:" + ConversationConstants.IDENTIFIER_LN); element.appendChild(elementIdentifier); String uuid = "uuid:" + UUIDGenerator.getUUID(); elementIdentifier.appendChild(doc.createTextNode(uuid)); setID(getWSSConfig().getIdAllocator().createSecureId("sctId-", element)); }
/** * Constructor to create the SCT * * @param doc */ public SecurityContextToken(int version, Document doc) throws ConversationException { String ns = ConversationConstants.getWSCNs(version); element = doc.createElementNS(ns, "wsc:" + ConversationConstants.SECURITY_CONTEXT_TOKEN_LN); WSSecurityUtil.setNamespace(element, ns, ConversationConstants.WSC_PREFIX); elementIdentifier = doc.createElementNS(ns, "wsc:" + ConversationConstants.IDENTIFIER_LN); element.appendChild(elementIdentifier); String uuid = "uuid:" + UUIDGenerator.getUUID(); elementIdentifier.appendChild(doc.createTextNode(uuid)); setID(getWSSConfig().getIdAllocator().createSecureId("sctId-", element)); }
public void prepare(Document doc, Crypto crypto) throws WSSecurityException, ConversationException { if (sct == null) { if (identifier != null) { sct = new SecurityContextToken(wscVersion, doc, identifier); } else { sct = new SecurityContextToken(wscVersion, doc); identifier = sct.getIdentifier(); } } // The wsu:Id of the wsc:SecurityContextToken if (sctId != null) { sct.setID(sctId); } }
public void prepare(Document doc, Crypto crypto) throws WSSecurityException, ConversationException { if (sct == null) { if (identifier != null) { sct = new SecurityContextToken(wscVersion, doc, identifier); } else { sct = new SecurityContextToken(wscVersion, doc); identifier = sct.getIdentifier(); } } // The wsu:Id of the wsc:SecurityContextToken if (sctId != null) { sct.setID(sctId); } }