public Document build(Document doc, WSSecHeader secHeader) throws WSSecurityException, ConversationException { // // Setup the encrypted key // prepare(doc); envelope = doc.getDocumentElement(); // // prepend elements in the right order to the security header // prependDKElementToHeader(secHeader); String soapNamespace = WSSecurityUtil.getSOAPNamespace(envelope); if (parts == null) { parts = new ArrayList<WSEncryptionPart>(1); WSEncryptionPart encP = new WSEncryptionPart( WSConstants.ELEM_BODY, soapNamespace, "Content" ); parts.add(encP); } Element externRefList = encryptForExternalRef(null, parts); addExternalRefElement(externRefList, secHeader); return doc; }
public Document build(Document doc, WSSecHeader secHeader) throws WSSecurityException, ConversationException { // // Setup the encrypted key // prepare(doc); envelope = doc.getDocumentElement(); // // prepend elements in the right order to the security header // prependDKElementToHeader(secHeader); String soapNamespace = WSSecurityUtil.getSOAPNamespace(envelope); if (parts == null) { parts = new ArrayList<WSEncryptionPart>(1); WSEncryptionPart encP = new WSEncryptionPart( WSConstants.ELEM_BODY, soapNamespace, "Content" ); parts.add(encP); } Element externRefList = encryptForExternalRef(null, parts); addExternalRefElement(externRefList, secHeader); return doc; }