public WSSecDerivedKeyBase(WSSecHeader securityHeader) { super(securityHeader); setKeyIdentifierType(0); }
public WSSecDKSign(WSSecHeader securityHeader) { super(securityHeader); init(null); }
/** * Get the List of inclusive prefixes from the DOM Element argument */ public List<String> getInclusivePrefixes(Element target) { return getInclusivePrefixes(target, true); }
SOAPPart soappart = message.getSOAPPart(); SOAPEnvelope envelope = soappart.getEnvelope(); SOAPHeader header = envelope.getHeader(); WSSecHeader wsheader = new WSSecHeader(); wsheader.insertSecurityHeader(soappart); WSSecUsernameToken token = new WSSecUsernameToken(); token.setPasswordType(WSConstants.PASSWORD_DIGEST); token.setUserInfo("myuser", "mypass"); token.build(soappart, wsheader);
/** * Appends the UsernameToken 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 UsernameToken element at any position in the * Security header. */ public void appendToHeader() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); securityHeaderElement.appendChild(ut.getElement()); }
public Document build() throws WSSecurityException { // // Setup the encrypted key // prepare(); // // prepend elements in the right order to the security header // prependDKElementToHeader(); Element externRefList = encrypt(); addAttachmentEncryptedDataElements(); addExternalRefElement(externRefList); return getDocument(); }
/** * Prepends the Timestamp 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 Timestamp element at any position in the Security * header. */ public void prependToHeader() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); WSSecurityUtil.prependChildElement(securityHeaderElement, ts.getElement()); }
public WSSecBase(Document doc) { this.doc = doc; securityHeader = new WSSecHeader(doc); }
/** * Append the BinarySecurityToken to the security header. */ public void appendBSTElementToHeader() { if (bstToken != null && !bstAddedToSecurityHeader) { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); securityHeaderElement.appendChild(bstToken); bstAddedToSecurityHeader = true; } }
/** * Append the EncryptedKey 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 EncryptedKey element at any position in the Security * header. */ public void appendToHeader() { Element secHeaderElement = getSecurityHeader().getSecurityHeaderElement(); secHeaderElement.appendChild(encryptedKeyElement); }
/** * Returns the SignatureElement. * The method can be called any time after <code>prepare()</code>. * @return The DOM Element of the signature. */ public Element getSignatureElement() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); return XMLUtils.getDirectChildElement( securityHeaderElement, WSConstants.SIG_LN, WSConstants.SIG_NS ); }
/** * Compute the Signature over the references. * * After references are set this method computes the Signature for them. * This method can be called any time after the references were set. See * <code>addReferencesToSign()</code>. * * @throws WSSecurityException */ public void computeSignature( List<javax.xml.crypto.dsig.Reference> referenceList ) throws WSSecurityException { computeSignature(referenceList, true, null); }
/** * Compute the Signature over the references. The signature element will be * prepended to the security header. * * This method can be called any time after the references were set. See * <code>addReferencesToSign()</code>. * * @param referenceList The list of references to sign * * @throws WSSecurityException */ public void computeSignature( List<javax.xml.crypto.dsig.Reference> referenceList ) throws WSSecurityException { computeSignature(referenceList, true, null); }
public WSSecSignature(WSSecHeader securityHeader) { super(securityHeader); init(null); }
/** * Prepends the UsernameToken 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 UsernameToken element at any position in the * Security header. */ public void prependToHeader() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); WSSecurityUtil.prependChildElement(securityHeaderElement, ut.getElement()); }
/** * Returns the SignatureElement. * The method can be called any time after <code>prepare()</code>. * @return The DOM Element of the signature. */ public Element getSignatureElement() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); return XMLUtils.getDirectChildElement( securityHeaderElement, WSConstants.SIG_LN, WSConstants.SIG_NS ); }
/** * Prepend the EncryptedKey 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 EncryptedKey element at any position in the Security * header. */ public void prependToHeader() { Element secHeaderElement = getSecurityHeader().getSecurityHeaderElement(); WSSecurityUtil.prependChildElement(secHeaderElement, encryptedKeyElement); }
public WSSecDerivedKeyBase(Document doc) { super(doc); setKeyIdentifierType(0); }
public WSSecDKSign(Document doc, Provider provider) { super(doc); init(provider); }
public WSSecSignature(Document doc, Provider provider) { super(doc); init(provider); }