/** * Adds a new <code>SignatureConfirmation</code> to a soap envelope. * * A complete <code>SignatureConfirmation</code> is constructed and added * to the <code>wsse:Security</code> header. * * @param sigVal the Signature value. This will be the content of the "Value" attribute. * @return Document with SignatureConfirmation added */ public Document build(byte[] sigVal) { LOG.debug("Begin add signature confirmation..."); signatureValue = sigVal; prepare(); prependToHeader(); return getDocument(); }
/** * Creates a SignatureConfimation element. * * The method prepares and initializes a WSSec SignatureConfirmation structure after * the relevant information was set. Before calling <code>prepare()</code> the * filed <code>signatureValue</code> must be set */ public void prepare() { sc = new SignatureConfirmation(getDocument(), signatureValue); sc.setID(getIdAllocator().createId("SC-", sc)); }
WSSecSignatureConfirmation wsc = new WSSecSignatureConfirmation(secHeader); wsc.setIdAllocator(wssConfig.getIdAllocator()); if (!signatureActions.isEmpty()) { for (WSSecurityEngineResult wsr : signatureActions) { byte[] sigVal = (byte[]) wsr.get(WSSecurityEngineResult.TAG_SIGNATURE_VALUE); wsc.setSignatureValue(sigVal); wsc.prepare(); addSupportingElement(wsc.getSignatureConfirmationElement()); if (sigParts != null) { WSEncryptionPart part = new WSEncryptionPart(wsc.getId(), "Element"); part.setElement(wsc.getSignatureConfirmationElement()); sigParts.add(part); sigConfList.add(part); wsc.prepare(); addSupportingElement(wsc.getSignatureConfirmationElement()); if (sigParts != null) { WSEncryptionPart part = new WSEncryptionPart(wsc.getId(), "Element"); part.setElement(wsc.getSignatureConfirmationElement()); sigParts.add(part); sigConfList.add(part);
WSSecSignatureConfirmation wsc = new WSSecSignatureConfirmation(reqData.getSecHeader()); wsc.setIdAllocator(reqData.getWssConfig().getIdAllocator()); wsc.setWsDocInfo(reqData.getWsDocInfo()); wsc.setExpandXopInclude(reqData.isExpandXopInclude()); SignatureActionToken signatureToken = (SignatureActionToken)actionToken; if (signatureToken == null) { || WSConstants.UT_SIGN == resultAction.intValue())) { byte[] sigVal = (byte[]) result.get(WSSecurityEngineResult.TAG_SIGNATURE_VALUE); wsc.build(sigVal); signatureParts.add(new WSEncryptionPart(wsc.getId())); signatureAdded = true; wsc.build(null); signatureParts.add(new WSEncryptionPart(wsc.getId()));
/** * Prepends the SignatureConfirmation element to the elements already in the * Security header. * * The method can be called any time after <code>prepare()</code>. * This allows to insert the SignatureConfirmation element at any position in the * Security header. */ public void prependToHeader() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); WSSecurityUtil.prependChildElement(securityHeaderElement, sc.getElement()); }
WSSecSignatureConfirmation wsc = new WSSecSignatureConfirmation(secHeader); wsc.setIdAllocator(wssConfig.getIdAllocator()); if (!signatureActions.isEmpty()) { for (WSSecurityEngineResult wsr : signatureActions) { byte[] sigVal = (byte[]) wsr.get(WSSecurityEngineResult.TAG_SIGNATURE_VALUE); wsc.setSignatureValue(sigVal); wsc.prepare(); addSupportingElement(wsc.getSignatureConfirmationElement()); if (sigParts != null) { WSEncryptionPart part = new WSEncryptionPart(wsc.getId(), "Element"); part.setElement(wsc.getSignatureConfirmationElement()); sigParts.add(part); sigConfList.add(part); wsc.prepare(); addSupportingElement(wsc.getSignatureConfirmationElement()); if (sigParts != null) { WSEncryptionPart part = new WSEncryptionPart(wsc.getId(), "Element"); part.setElement(wsc.getSignatureConfirmationElement()); sigParts.add(part); sigConfList.add(part);