TokenValue tokenValue = new TokenValue("Id", WSConstants.WSU_NS, element); TokenValue previousValue = tokens.put(id, tokenValue); if (checkMultipleElements && previousValue != null) { TokenValue tokenValue = new TokenValue("Id", null, element); TokenValue previousValue = tokens.put(id, tokenValue); if (checkMultipleElements && previousValue != null) { && element.hasAttributeNS(null, "AssertionID")) { String id = element.getAttributeNS(null, "AssertionID"); TokenValue tokenValue = new TokenValue("AssertionID", null, element); TokenValue previousValue = tokens.put(id, tokenValue); if (checkMultipleElements && previousValue != null) { && element.hasAttributeNS(null, "ID")) { String id = element.getAttributeNS(null, "ID"); TokenValue tokenValue = new TokenValue("ID", null, element); TokenValue previousValue = tokens.put(id, tokenValue); if (checkMultipleElements && previousValue != null) {
/** * Set all stored tokens on the DOMCryptoContext argument * @param context */ public void setTokensOnContext(DOMCryptoContext context) { if (!tokens.isEmpty() && context != null) { for (Map.Entry<String, TokenValue> entry : tokens.entrySet()) { TokenValue tokenValue = entry.getValue(); context.setIdAttributeNS(tokenValue.getToken(), tokenValue.getIdNamespace(), tokenValue.getIdName()); } } }
/** * Get a token Element for the given Id. The Id can be either a wsu:Id or a * SAML AssertionID/ID. * @param uri is the (relative) uri of the id * @return the token element or null if nothing found */ public Element getTokenElement(String uri) { String id = XMLUtils.getIDFromReference(uri); if (id == null) { return null; } TokenValue token = tokens.get(id); if (token != null) { return token.getToken(); } return null; }
public void setTokenOnContext(String uri, DOMCryptoContext context) { String id = XMLUtils.getIDFromReference(uri); if (id == null || context == null) { return; } TokenValue tokenValue = tokens.get(id); if (tokenValue != null) { context.setIdAttributeNS(tokenValue.getToken(), tokenValue.getIdNamespace(), tokenValue.getIdName()); } }