Package org.apache.wss4j.dom.message
Class WSSecHeader
- java.lang.Object
-
- org.apache.wss4j.dom.message.WSSecHeader
-
public class WSSecHeader extends Object
This class implements WS Security header. Setup a Security header with a specified actor and mustunderstand flag. The defaults for actor and mustunderstand are: emptyactor
andmustunderstand
is true.
-
-
Constructor Summary
Constructors Constructor Description WSSecHeader(String act, boolean mu, Document doc)
Constructor.WSSecHeader(String actor, Document doc)
Constructor.WSSecHeader(Document doc)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
getSecurityHeaderDoc()
Get the security header document of this instance.Element
getSecurityHeaderElement()
Get the security header element of this instance.String
getWsuPrefix()
Element
insertSecurityHeader()
Creates a security header and inserts it as child into the SOAP Envelope.boolean
isEmpty()
Returns whether the security header is emptyvoid
removeSecurityHeader()
void
setActor(String act)
set actor name.void
setMustUnderstand(boolean mu)
Set themustUnderstand
flag for thewsse:Security
header.void
setSecurityHeaderElement(Element securityHeaderElement)
-
-
-
Constructor Detail
-
WSSecHeader
public WSSecHeader(Document doc)
Constructor.- Parameters:
doc
- The Document to use when creating the security header
-
WSSecHeader
public WSSecHeader(String actor, Document doc)
Constructor.- Parameters:
actor
- The actor name of thewsse:Security
headerdoc
- The Document to use when creating the security header
-
-
Method Detail
-
setActor
public void setActor(String act)
set actor name.- Parameters:
act
- The actor name of thewsse:Security
header
-
setMustUnderstand
public void setMustUnderstand(boolean mu)
Set themustUnderstand
flag for thewsse:Security
header.- Parameters:
mu
- SetmustUnderstand
to true or false
-
getSecurityHeaderDoc
public Document getSecurityHeaderDoc()
Get the security header document of this instance.- Returns:
- The security header element.
-
getSecurityHeaderElement
public Element getSecurityHeaderElement()
Get the security header element of this instance.- Returns:
- The security header element.
-
setSecurityHeaderElement
public void setSecurityHeaderElement(Element securityHeaderElement)
-
isEmpty
public boolean isEmpty() throws WSSecurityException
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
public Element insertSecurityHeader() throws WSSecurityException
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:Security
element - Throws:
WSSecurityException
-
removeSecurityHeader
public void removeSecurityHeader() throws WSSecurityException
- Throws:
WSSecurityException
-
getWsuPrefix
public String getWsuPrefix()
-
-