Package org.apache.wss4j.dom.message
Class WSSecHeader
java.lang.Object
org.apache.wss4j.dom.message.WSSecHeader
This class implements WS Security header.
Setup a Security header with a specified actor and mustunderstand flag.
The defaults for actor and mustunderstand are: empty
actor and
mustunderstand is true.-
Constructor Summary
ConstructorsConstructorDescriptionWSSecHeader(String act, boolean mu, Document doc) Constructor.WSSecHeader(String actor, Document doc) Constructor.WSSecHeader(Document doc) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the security header document of this instance.Get the security header element of this instance.Creates a security header and inserts it as child into the SOAP Envelope.booleanisEmpty()Returns whether the security header is emptyvoidvoidset actor name.voidsetMustUnderstand(boolean mu) Set themustUnderstandflag for thewsse:Securityheader.voidsetSecurityHeaderElement(Element securityHeaderElement)
-
Constructor Details
-
WSSecHeader
Constructor.- Parameters:
doc- The Document to use when creating the security header
-
WSSecHeader
Constructor.- Parameters:
actor- The actor name of thewsse:Securityheaderdoc- The Document to use when creating the security header
-
WSSecHeader
Constructor.- Parameters:
act- The actor name of thewsse:Securityheadermu- SetmustUnderstandto true or falsedoc- The Document to use when creating the security header
-
-
Method Details
-
setActor
set actor name.- Parameters:
act- The actor name of thewsse:Securityheader
-
setMustUnderstand
public void setMustUnderstand(boolean mu) Set themustUnderstandflag for thewsse:Securityheader.- Parameters:
mu- SetmustUnderstandto true or false
-
getSecurityHeaderDoc
Get the security header document of this instance.- Returns:
- The security header element.
-
getSecurityHeaderElement
Get the security header element of this instance.- Returns:
- The security header element.
-
setSecurityHeaderElement
-
isEmpty
Returns whether the security header is empty- Returns:
- true if empty or if there is no security header false if non empty security header
- Throws:
WSSecurityException
-
insertSecurityHeader
Creates a security header and inserts it as child into the SOAP Envelope. Check if a WS Security header block for an actor is already available in the document. If a header block is found return it, otherwise a new wsse:Security header block is created and the attributes set- Returns:
- A
wsse:Securityelement - Throws:
WSSecurityException
-
removeSecurityHeader
- Throws:
WSSecurityException
-
getWsuPrefix
-