org.apache.ws.security.message
Class WSBaseMessage

java.lang.Object
  extended byorg.apache.ws.security.message.WSBaseMessage
Direct Known Subclasses:
WSAddSignatureConfirmation, WSAddTimestamp, WSEncryptBody, WSSAddSAMLToken, WSSAddUsernameToken, WSSignEnvelope

public class WSBaseMessage
extends java.lang.Object

This is the base class for WS Security messages. It provides common functions and fields used by the specific message classes such as sign, encrypt, and username token.

Author:
Werner Dittmann ([email protected])

Field Summary
protected  java.lang.String actor
           
protected  boolean doDebug
           
protected  int keyIdentifierType
           
protected  boolean mustunderstand
           
protected  java.util.Vector parts
           
protected  java.lang.String password
           
protected  int timeToLive
           
protected  java.lang.String user
           
protected  WSSConfig wssConfig
           
 
Constructor Summary
WSBaseMessage()
          Deprecated. replaced by WSSecBase.WSSecBase()
WSBaseMessage(java.lang.String actor)
          Deprecated. replaced by WSSecBase.WSSecBase() and WSSecHeader for actor specification.
WSBaseMessage(java.lang.String actor, boolean mu)
          Deprecated. replaced by WSSecBase.WSSecBase() and WSSecHeader for actor and mustunderstand specification.
 
Method Summary
 int getKeyIdentifierType()
          Deprecated. replaced by WSSecBase.getKeyIdentifierType()
protected  org.w3c.dom.Element insertSecurityHeader(org.w3c.dom.Document doc)
          Deprecated. replaced by WSSecHeader.insertSecurityHeader(Document)
 void setActor(java.lang.String act)
          Deprecated. replaced by WSSecHeader.setActor(String)
protected  java.lang.String setBodyID(org.w3c.dom.Document doc)
          Deprecated. replaced by WSSecBase.setBodyID(Document)
 void setKeyIdentifierType(int keyIdType)
          Deprecated. replaced by WSSecBase.setKeyIdentifierType(int)
 void setMustUnderstand(boolean mu)
          Deprecated. replaced by WSSecHeader.setMustUnderstand(boolean)
 void setParts(java.util.Vector parts)
          Deprecated. replaced by WSSecBase.setParts(Vector)
 void setTimeToLive(int ttl)
          Deprecated. replaced by WSSecTimestamp.setTimeToLive(int)
 void setUserInfo(java.lang.String user, java.lang.String password)
          Deprecated. replaced by WSSecBase.setUserInfo(String, String)
 void setWsConfig(WSSConfig wsConfig)
          Deprecated. replaced by WSSecBase.setWsConfig(WSSConfig)
protected  java.lang.String setWsuId(org.w3c.dom.Element bodyElement)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actor

protected java.lang.String actor

mustunderstand

protected boolean mustunderstand

user

protected java.lang.String user

password

protected java.lang.String password

keyIdentifierType

protected int keyIdentifierType

parts

protected java.util.Vector parts

timeToLive

protected int timeToLive

doDebug

protected boolean doDebug

wssConfig

protected WSSConfig wssConfig
Constructor Detail

WSBaseMessage

public WSBaseMessage()
Deprecated. replaced by WSSecBase.WSSecBase()

Constructor.


WSBaseMessage

public WSBaseMessage(java.lang.String actor)
Deprecated. replaced by WSSecBase.WSSecBase() and WSSecHeader for actor specification.

Constructor.

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

WSBaseMessage

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

Constructor.

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

setActor

public void setActor(java.lang.String act)
Deprecated. replaced by WSSecHeader.setActor(String)

set actor name.

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

setTimeToLive

public void setTimeToLive(int ttl)
Deprecated. replaced by WSSecTimestamp.setTimeToLive(int)

Set the time to live. This is the time difference in seconds between the Created and the Expires in Timestamp.

Parameters:
ttl - The time to live in second

setParts

public void setParts(java.util.Vector parts)
Deprecated. replaced by WSSecBase.setParts(Vector)

Set which parts of the message to encrypt/sign.

Parameters:
parts - The vector containing the WSEncryptionPart objects

setMustUnderstand

public void setMustUnderstand(boolean mu)
Deprecated. replaced by WSSecHeader.setMustUnderstand(boolean)

Set the mustUnderstand flag for the wsse:Security header

Parameters:
mu - Set mustUnderstand to true or false

setKeyIdentifierType

public void setKeyIdentifierType(int keyIdType)
Deprecated. replaced by WSSecBase.setKeyIdentifierType(int)

Sets which key identifier to use.

Defines the key identifier type to use in the signature or the ecnryption function to set up the key identification elements.

Parameters:
keyIdType -
See Also:
WSConstants.ISSUER_SERIAL, WSConstants.BST_DIRECT_REFERENCE, WSConstants.X509_KEY_IDENTIFIER, WSConstants.SKI_KEY_IDENTIFIER

getKeyIdentifierType

public int getKeyIdentifierType()
Deprecated. replaced by WSSecBase.getKeyIdentifierType()

Gets the value of the keyIdentifyerType.

Returns:
The keyIdentifyerType.
See Also:
WSConstants.ISSUER_SERIAL, WSConstants.BST_DIRECT_REFERENCE, WSConstants.X509_KEY_IDENTIFIER, WSConstants.SKI_KEY_IDENTIFIER

setWsConfig

public void setWsConfig(WSSConfig wsConfig)
Deprecated. replaced by WSSecBase.setWsConfig(WSSConfig)

Parameters:
wsConfig - The wsConfig to set.

setBodyID

protected java.lang.String setBodyID(org.w3c.dom.Document doc)
                              throws java.lang.Exception
Deprecated. replaced by WSSecBase.setBodyID(Document)

Looks up or adds a body id.

First try to locate the wsu:Id in the SOAP body element. If one is found, the value of the wsu:Id attribute is returned. Otherwise the methode generates a new wsu:Id and an appropriate value.

Parameters:
doc - The SOAP envelope as Document
Returns:
The value of the wsu:Id attribute of the SOAP body
Throws:
java.lang.Exception

setWsuId

protected java.lang.String setWsuId(org.w3c.dom.Element bodyElement)

setUserInfo

public void setUserInfo(java.lang.String user,
                        java.lang.String password)
Deprecated. replaced by WSSecBase.setUserInfo(String, String)

Set the user and password info.

Both information is used to get the user's private signing key.

Parameters:
user - This is the user's alias name in the keystore that identifies the private key to sign the document
password - The user's password to get the private signing key from the keystore

insertSecurityHeader

protected org.w3c.dom.Element insertSecurityHeader(org.w3c.dom.Document doc)
Deprecated. replaced by WSSecHeader.insertSecurityHeader(Document)

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


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