/** * Get the id generated during <code>prepare()</code>. * * Returns the the value of wsu:Id attribute of this SignatureConfirmation. * * @return Return the wsu:Id of this token or null if <code>prepareToken()</code> * was not called before. */ public String getId() { if (sc == null) { return null; } return sc.getID(); }
/** * Constructs a <code>SignatureConfirmation</code> object and parses the * <code>wsse11:SignatureConfirmation</code> element to initialize it. * * @param elem the <code>wsse11:SignatureCOnfirmation</code> element that * contains the confirmation data * @param bspEnforcer a BSPEnforcer instance used to enforce BSP rules */ public SignatureConfirmation(Element elem, BSPEnforcer bspEnforcer) throws WSSecurityException { element = elem; String id = getID(); if (id == null || "".equals(id)) { bspEnforcer.handleBSPRule(BSPRule.R5441); } String sv = element.getAttributeNS(null, SC_VALUE_ATTR); if (sv != null) { signatureValue = org.apache.xml.security.utils.XMLUtils.decode(sv); } }
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); }