/** * Store a token element for later retrieval. Before storing the token, we check for a * previously processed token with the same (wsu/SAML) Id. * @param element is the token element to store */ public void addTokenElement(Element element) throws WSSecurityException { addTokenElement(element, true); }
protected void marshalKeyInfo(WSDocInfo wsDocInfo) throws WSSecurityException { List<XMLStructure> kiChildren = null; if (customKeyInfoElement == null) { XMLStructure structure = new DOMStructure(secRef.getElement()); wsDocInfo.addTokenElement(secRef.getElement(), false); kiChildren = Collections.singletonList(structure); } else { Node kiChild = customKeyInfoElement.getFirstChild(); kiChildren = new ArrayList<>(); while (kiChild != null) { kiChildren.add(new DOMStructure(kiChild)); kiChild = kiChild.getNextSibling(); } } KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory(); keyInfo = keyInfoFactory.newKeyInfo(kiChildren, keyInfoUri); }
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug("Found reference list element"); List<WSDataRef> dataRefs = handleReferenceList(elem, data); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.ENCR, dataRefs); String tokenId = elem.getAttributeNS(null, "Id"); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return Collections.singletonList(result); }
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug("Found SignatureConfirmation list element"); // // Decode SignatureConfirmation, just store in result // SignatureConfirmation sigConf = new SignatureConfirmation(elem, data.getBSPEnforcer()); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.SC, sigConf); String tokenId = sigConf.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } data.getWsDocInfo().addResult(result); data.getWsDocInfo().addTokenElement(elem); return java.util.Collections.singletonList(result); }
WSSecurityUtil.storeBytesInAttachment(bstToken, getDocument(), attachmentId, certBytes, attachmentCallbackHandler); getWsDocInfo().addTokenElement(bstToken, false); } else { BinarySecurity binarySecurity = null; getWsDocInfo().addTokenElement(bstToken, false);
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug("Found Timestamp list element"); // // Decode Timestamp, add the found time (created/expiry) to result // Timestamp timestamp = new Timestamp(elem, data.getBSPEnforcer()); Credential credential = new Credential(); credential.setTimestamp(timestamp); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.TS, timestamp); String tokenId = timestamp.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } Validator validator = data.getValidator(WSConstants.TIMESTAMP); if (validator != null) { validator.validate(credential, data); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); } data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result); }
cloneElement(element); wsDocInfo.addTokenElement(element, false); } else if (!encPart.isRequired()) { continue; ); referenceList.add(reference); wsDocInfo.addTokenElement(elementToSign, false);
data.getWsDocInfo().addTokenElement(elem);
data.getWsDocInfo().addTokenElement(elem); WSSecurityEngineResult result = null; if (samlAssertion.isSigned()) {
data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result);
data.getWsDocInfo().addTokenElement(elem); return Collections.singletonList(result);
data.getWsDocInfo().addTokenElement(elem); if (!"".equals(id)) { result.put(WSSecurityEngineResult.TAG_ID, id);
binarySecurity.setID(certUri); bstToken = binarySecurity.getElement(); getWsDocInfo().addTokenElement(bstToken, false); ref.setValueType(binarySecurity.getValueType()); secRef.setReference(ref);
data.getWsDocInfo().addTokenElement(elem); return java.util.Collections.singletonList(result);
wsDocInfo.addTokenElement(secRef.getElement(), false); KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory(); keyInfo =
data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result);
elem.appendChild(keyId); getWsDocInfo().addTokenElement(secRefSaml.getElement(), false); configureKeyInfo(secRef, cert, iCrypto != null ? iCrypto : uCrypto, samlAssertion); getWsDocInfo().addTokenElement(samlToken, false);
WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.DKT, null, keyBytes, null); data.getWsDocInfo().addTokenElement(elem); String tokenId = dkt.getID(); if (!"".equals(tokenId)) {