Class UsernameToken

All Implemented Interfaces:
com.sun.xml.ws.security.Token, SecurityHeaderBlock, SecurityToken, javax.xml.soap.Node, javax.xml.soap.SOAPElement, Element, Node

public class UsernameToken extends SecurityHeaderBlockImpl implements SecurityToken, com.sun.xml.ws.security.Token
Support for a WSS:Username Token Profile. Represents a wsse:UsernameToken.
Author:
Manveen Kaur, Edwin Goei
  • Field Details

  • Constructor Details

  • Method Details

    • fromSoapElement

      public static SecurityHeaderBlock fromSoapElement(javax.xml.soap.SOAPElement element) throws com.sun.xml.wss.XWSSecurityException
      Throws:
      com.sun.xml.wss.XWSSecurityException
    • getUsername

      public String getUsername()
      Returns:
      Returns the username.
    • setUsername

      public void setUsername(String username)
    • getPassword

      public String getPassword()
      Returns:
      Returns the password which may be null meaning no password.
    • getPasswordType

      public String getPasswordType()
      Returns:
      Returns the passwordType.
    • getNonceEncodingType

      public String getNonceEncodingType()
      Returns:
      Returns the Nonce Encoding type.
    • getNonce

      public String getNonce() throws SecurityTokenException
      Returns:
      Returns the encoded nonce. Null indicates no nonce was set.
      Throws:
      SecurityTokenException
    • getCreated

      public String getCreated()
      Returns the created which may be null meaning no time of creation.
    • getPasswordDigest

      public String getPasswordDigest()
    • setPassword

      public void setPassword(String passwd)
      Sets the password.
      Parameters:
      passwd -
    • setNonce

      public void setNonce(String nonceValue)
      set the nonce value.If nonce value is null then it will create one.
      Parameters:
      nonceValue -
    • setCreationTime

      public void setCreationTime(String time) throws com.sun.xml.wss.XWSSecurityException
      set the creation time.
      Parameters:
      time - If null or empty then this method would create one.
      Throws:
      com.sun.xml.wss.XWSSecurityException
    • setDigestOn

      public void setDigestOn() throws SecurityTokenException
      Throws:
      SecurityTokenException
    • getAsSoapElement

      public javax.xml.soap.SOAPElement getAsSoapElement() throws SecurityTokenException
      Specified by:
      getAsSoapElement in interface SecurityHeaderBlock
      Overrides:
      getAsSoapElement in class SecurityHeaderBlockImpl
      Throws:
      SecurityTokenException
    • isBSP

      public void isBSP(boolean flag)
      Overrides:
      isBSP in class SecurityHeaderBlockImpl
    • isBSP

      public boolean isBSP()
      Overrides:
      isBSP in class SecurityHeaderBlockImpl
    • getType

      public String getType()
      Specified by:
      getType in interface com.sun.xml.ws.security.Token
    • getTokenValue

      public Object getTokenValue()
      Specified by:
      getTokenValue in interface com.sun.xml.ws.security.Token