org.apache.ws.security.message
Class WSSAddUsernameToken

java.lang.Object
  extended byorg.apache.ws.security.message.WSBaseMessage
      extended byorg.apache.ws.security.message.WSSAddUsernameToken

public class WSSAddUsernameToken
extends WSBaseMessage

Builds a WS UsernameToken and inserts it into the SOAP Envelope. Refer to the WS specification, UsernameToken profile

Author:
Werner Dittmann (Werner.Dittmann@siemens.com).

Field Summary
 
Fields inherited from class org.apache.ws.security.message.WSBaseMessage
actor, doDebug, keyIdentifierType, mustunderstand, parts, password, timeToLive, user, wssConfig
 
Constructor Summary
WSSAddUsernameToken()
          Deprecated. replaced by WSSecUsernameToken.WSSecUsernameToken()
WSSAddUsernameToken(java.lang.String actor)
          Deprecated. replaced by WSSecUsernameToken.WSSecUsernameToken() and WSSecHeader for actor specification.
WSSAddUsernameToken(java.lang.String actor, boolean mu)
          Deprecated. replaced by WSSecUsernameToken.WSSecUsernameToken() and WSSecHeader for actor and mustunderstand specification.
 
Method Summary
 void addCreated(org.w3c.dom.Document doc)
          Deprecated. replaced by WSSecUsernameToken.addCreated()
 void addNonce(org.w3c.dom.Document doc)
          Deprecated. replaced by WSSecUsernameToken.addNonce()
 org.w3c.dom.Document build(org.w3c.dom.Document doc, java.lang.String username, java.lang.String password)
          Deprecated. replaced by WSSecUsernameToken.build(Document, WSSecHeader) and WSSecBase.setUserInfo(String, String)
 java.lang.String getId()
          Deprecated. replaced by WSSecUsernameToken.getId()
 byte[] getSecretKey()
          Deprecated. replaced by WSSecUsernameToken.getSecretKey()
 org.w3c.dom.Document preSetUsernameToken(org.w3c.dom.Document doc, java.lang.String username, java.lang.String password)
           
 void setId(java.lang.String id)
          Deprecated. no replacement, id is created by default in WSSecUsernameToken
 void setPasswordType(java.lang.String pwType)
          Deprecated. replaced by WSSecUsernameToken.setPasswordType(String)
 
Methods inherited from class org.apache.ws.security.message.WSBaseMessage
getKeyIdentifierType, insertSecurityHeader, setActor, setBodyID, setKeyIdentifierType, setMustUnderstand, setParts, setTimeToLive, setUserInfo, setWsConfig, setWsuId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSSAddUsernameToken

public WSSAddUsernameToken()
Deprecated. replaced by WSSecUsernameToken.WSSecUsernameToken()

Constructor.


WSSAddUsernameToken

public WSSAddUsernameToken(java.lang.String actor)
Deprecated. replaced by WSSecUsernameToken.WSSecUsernameToken() and WSSecHeader for actor specification.

Constructor.

Parameters:
actor - the name of the actor of the wsse:Security header

WSSAddUsernameToken

public WSSAddUsernameToken(java.lang.String actor,
                           boolean mu)
Deprecated. replaced by WSSecUsernameToken.WSSecUsernameToken() and WSSecHeader for actor and mustunderstand specification.

Constructor.

Parameters:
actor - The name of the actor of the wsse:Security header
mu - Set mustUnderstand to true or false
Method Detail

setPasswordType

public void setPasswordType(java.lang.String pwType)
Deprecated. replaced by WSSecUsernameToken.setPasswordType(String)

Defines how to construct the password element of the UsernameToken.

Parameters:
pwType - contains the password type. Only allowed values are WSConstants.PASSWORD_DIGEST and WSConstants.PASSWORD_TEXT.

addNonce

public void addNonce(org.w3c.dom.Document doc)
Deprecated. replaced by WSSecUsernameToken.addNonce()

Creates and adds a Nonce element to the UsernameToken.


addCreated

public void addCreated(org.w3c.dom.Document doc)
Deprecated. replaced by WSSecUsernameToken.addCreated()

Creates and adds a Created element to the UsernameToken.


setId

public void setId(java.lang.String id)
Deprecated. no replacement, id is created by default in WSSecUsernameToken

set the id

Parameters:
id -

getSecretKey

public byte[] getSecretKey()
Deprecated. replaced by WSSecUsernameToken.getSecretKey()

Get a secret key derived from values in UsernameToken.

Returns:
a secret key

getId

public java.lang.String getId()
Deprecated. replaced by WSSecUsernameToken.getId()

get the id

Returns:
The id

preSetUsernameToken

public org.w3c.dom.Document preSetUsernameToken(org.w3c.dom.Document doc,
                                                java.lang.String username,
                                                java.lang.String password)

build

public org.w3c.dom.Document build(org.w3c.dom.Document doc,
                                  java.lang.String username,
                                  java.lang.String password)
Deprecated. replaced by WSSecUsernameToken.build(Document, WSSecHeader) and WSSecBase.setUserInfo(String, String)

Adds a new UsernameToken to a soap envelope.

A complete UsernameToken is constructed and added to the wsse:Security header.

Parameters:
doc - The SOAP envelope as W3C document
username - The username to set in the UsernameToken
password - The password of the user
Returns:
Document with UsernameToken added


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.