Class WSSecHeader

java.lang.Object
org.apache.ws.security.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: empty actor and mustunderstand is true.

Author:
Werner Dittmann (Werner.Dittmann@apache.org)
  • Field Details

    • actor

      protected String actor
    • mustunderstand

      protected boolean mustunderstand
    • doDebug

      protected boolean doDebug
  • Constructor Details

    • WSSecHeader

      public WSSecHeader()
      Constructor.
    • WSSecHeader

      public WSSecHeader(String actor)
      Constructor.
      Parameters:
      actor - The actor name of the wsse:Security header
    • WSSecHeader

      public WSSecHeader(String act, boolean mu)
      Constructor.
      Parameters:
      mu - Set mustUnderstand to true or false
      actor - The actor name of the wsse:Security header
  • Method Details

    • setActor

      public void setActor(String act)
      set actor name.
      Parameters:
      act - The actor name of the wsse:Security header
    • setMustUnderstand

      public void setMustUnderstand(boolean mu)
      Set the mustUnderstand flag for the wsse:Security header.
      Parameters:
      mu - Set mustUnderstand to true or false
    • getSecurityHeader

      public Element getSecurityHeader()
      Get the security header element of this instance.
      Returns:
      The security header element.
    • insertSecurityHeader

      public Element insertSecurityHeader(Document doc)
      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

      Parameters:
      doc - A SOAP envelope as Document
      Returns:
      A wsse:Security element