com.ibm.wsspi.wssecurity.auth.token

Class WSSToken

  1. java.lang.Object
  2. extended bycom.ibm.wsspi.wssecurity.auth.token.WSSToken
All implemented interfaces:
PropagationToken, Token, java.lang.Cloneable
Direct known subclasses:
LTPAToken, UsernameToken, X509BSToken

  1. public abstract class WSSToken
  2. extends java.lang.Object
  3. implements Token
A default implementation of the Token interface for processing security tokens. Protected by following Java 2 Security permissions: com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.WSSToken.setTrusted") com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.WSSToken.addAttribute") com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.WSSToken.setUsedTokenConsumer")
See Also:
Token

Nested Class Summary

Modifier and Type Class and Description
  1. protected class
WSSToken.AttributesEnumerator

Field Summary

Modifier and Type Field and Description
  1. protected
  2. java.util.HashMap
_attributes
  1. protected
  2. boolean
_callerChecked
  1. protected
  2. SoapSecurityException
_error
  1. protected
  2. java.lang.String
_keyInfoType
  1. protected
  2. boolean
_processed
  1. protected
  2. boolean
_referenced
  1. protected
  2. org.w3c.dom.Element
_tokenelem
  1. protected
  2. java.lang.String
_tokenId
  1. protected
  2. boolean
_trusted
  1. protected
  2. TokenConsumerConfig
_usedTokenConsumer
  1. protected
  2. TokenGeneratorConfig
_usedTokenGenerator
  1. protected
  2. boolean
_usedToLogin
  1. protected static
  2. short
_version
  1. protected
  2. javax.xml.namespace.QName
_vtype

Constructor Summary

Constructor and Description
WSSToken()

Method Summary

Modifier and Type Method and Description
  1. java.lang.String[]
addAttribute(java.lang.String key,java.lang.String value)
Adds an attribute in the form of a key-value pair.
  1. java.lang.Object
clone()
Returns a copy of this class instance
  1. java.util.Enumeration
getAttributeNames()
Returns the enumeration of attribute names.
  1. java.lang.String[]
getAttributes(java.lang.String key)
Returns the attributes of the specified key.
  1. byte[]
getBytes()
Returns the byte array representation of this token if possible.
  1. boolean
getCallerChecked()
Returns if the caller check has been done or not.
  1. org.w3c.dom.Element
getElement()
Returns DOM expression of the token.
  1. SoapSecurityException
getError()
Returns the error that occurs during token processing.
  1. java.lang.String
getId()
Returns id string of this token.
  1. java.lang.String
getKeyInfoType()
Gets the KeyInfo's type.
  1. java.lang.String
getName()
Returns the implementation class name
  1. javax.xml.namespace.QName
getType()
Returns the value type of the token in the form of a QName object.
  1. TokenConsumerConfig
getUsedTokenConsumer()
Returns the configuration of token consumer.
  1. TokenGeneratorConfig
getUsedTokenGenerator()
Returns the configuration of token generator.
  1. boolean
getUsedToLogin()
Checks whether the token is used to login or not.
  1. short
getVersion()
Returns the implementation version
  1. boolean
isForwardable()
Checks if the token is forwardable or not
  1. boolean
isProcessed()
Returns if the token is processed or not.
  1. boolean
isReadOnly()
  1. boolean
isReferenced()
Returns if the token is referenced in the message or not.
  1. boolean
isTrusted()
Returns auth required flag
  1. void
setCallerChecked(boolean isCallerChecked)
Sets the whether the caller check has been done or not.
  1. void
setElement(org.w3c.dom.Element elem)
Sets DOM expression of the token.
  1. void
setError(SoapSecurityException error)
Sets the error that occurs during token processing.
  1. void
setId(java.lang.String tid)
Sets id string of this token.
  1. void
setKeyInfoType(java.lang.String keyInfoType)
Sets the KeyInfo's type.
  1. void
setProcessed(boolean isProcessed)
Sets if the token is processed or not.
  1. void
setReadOnly()
  1. void
setReferenced(boolean isReferenced)
Sets whether the token is referenced in the message or not.
  1. void
setTrusted(boolean trusted)
Sets auth required flag.
  1. void
setType(javax.xml.namespace.QName type)
Sets the value type of the token in the form of a QName object.
  1. void
setType(java.lang.String uri,java.lang.String localName)
Sets the value type of the token by a URI -- local name pair (i.e., qname).
  1. void
setUsedTokenConsumer(TokenConsumerConfig usedConfig)
Sets the configuration of token consumer.
  1. void
setUsedTokenGenerator(TokenGeneratorConfig usedConfig)
Sets the configuration of token generator.
  1. void
setUsedToLogin(boolean usedToLogin)
Sets the flag that indicates whether the token is used to login.
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ibm.wsspi.security.token.Token
getExpiration, getPrincipal, getUniqueID, isValid

Field Detail

_version

  1. protected static final short _version
See Also:

_attributes

  1. protected java.util.HashMap _attributes

_tokenId

  1. protected java.lang.String _tokenId

_tokenelem

  1. protected org.w3c.dom.Element _tokenelem

_vtype

  1. protected javax.xml.namespace.QName _vtype

_keyInfoType

  1. protected java.lang.String _keyInfoType

_trusted

  1. protected boolean _trusted

_usedToLogin

  1. protected boolean _usedToLogin

_callerChecked

  1. protected boolean _callerChecked

_referenced

  1. protected boolean _referenced

_usedTokenGenerator

  1. protected TokenGeneratorConfig _usedTokenGenerator

_usedTokenConsumer

  1. protected TokenConsumerConfig _usedTokenConsumer

_processed

  1. protected boolean _processed

_error

  1. protected SoapSecurityException _error

Constructor Detail

WSSToken

  1. public WSSToken()

Method Detail

getId

  1. public java.lang.String getId()
Returns id string of this token.
Returns:
id string

setId

  1. public void setId(java.lang.String tid)
Sets id string of this token.
Parameters:
tid -

getElement

  1. public org.w3c.dom.Element getElement( )
Returns DOM expression of the token.
Returns:
a token element in the form of Element object

setElement

  1. public void setElement(org.w3c.dom.Element elem)
Sets DOM expression of the token.
Parameters:
elem - An Element of the token itself

getType

  1. public javax.xml.namespace.QName getType( )
Returns the value type of the token in the form of a QName object.
Returns:
A value type

setType

  1. public void setType(javax.xml.namespace.QName type)
Sets the value type of the token in the form of a QName object.
Parameters:
type - a qname of the token

setType

  1. public void setType(java.lang.String uri,
  2. java.lang.String localName)
Sets the value type of the token by a URI -- local name pair (i.e., qname).
Parameters:
uri -
localName -

getKeyInfoType

  1. public java.lang.String getKeyInfoType( )
Gets the KeyInfo's type.
Returns:
The KeyInfo's type

setKeyInfoType

  1. public void setKeyInfoType(java.lang.String keyInfoType)
Sets the KeyInfo's type.
Parameters:
keyInfoType - The KeyInfo's type

getBytes

  1. public byte[] getBytes()
Returns the byte array representation of this token if possible.
Specified by:
getBytes in interface Token
Returns:
The byte array representation of this token

getName

  1. public java.lang.String getName( )
Returns the implementation class name
Specified by:
getName in interface Token
Returns:
The implementation class name

getVersion

  1. public short getVersion()
Returns the implementation version
Specified by:
getVersion in interface Token
Returns:
The implementation version

isForwardable

  1. public boolean isForwardable()
Checks if the token is forwardable or not
Specified by:
isForwardable in interface Token
Returns:
True if the token is forwardable, false otherwise

clone

  1. public java.lang.Object clone()
Returns a copy of this class instance
Specified by:
clone in interface Token
Overrides:
clone in class java.lang.Object
Returns:
A copy of this class instance

setTrusted

  1. public void setTrusted(boolean trusted)
Sets auth required flag.
Parameters:
trusted - True if auth is required, false otherwise Protected by Java 2 Security permission com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.WSSToken.setTrusted")

isTrusted

  1. public boolean isTrusted()
Returns auth required flag
Returns:
True if auth is required, false otherwise

setUsedToLogin

  1. public void setUsedToLogin(boolean usedToLogin)
Sets the flag that indicates whether the token is used to login.
Parameters:
usedToLogin - True if the token is used to login, false otherwise

getUsedToLogin

  1. public boolean getUsedToLogin()
Checks whether the token is used to login or not.
Returns:
True if the token is used to login, false otherwise

getAttributeNames

  1. public java.util.Enumeration getAttributeNames( )
Returns the enumeration of attribute names.
Specified by:
getAttributeNames in interface Token
Returns:
The enumeration of attribute names

getAttributes

  1. public java.lang.String[] getAttributes( java.lang.String key)
Returns the attributes of the specified key.
Specified by:
getAttributes in interface Token
Parameters:
key - The key of the attributes to retrieve
Returns:
The String[] of attributes of the specified key

addAttribute

  1. public java.lang.String[] addAttribute( java.lang.String key,
  2. java.lang.String value)
Adds an attribute in the form of a key-value pair.
Specified by:
addAttribute in interface Token
Parameters:
key - The key of the attribute to add
value - The value of the attribute to add
Returns:
The String[] representation of the set of attributes Protected by Java 2 Security Permission com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.WSSToken.addAttribute")

setCallerChecked

  1. public void setCallerChecked(boolean isCallerChecked)
Sets the whether the caller check has been done or not.
Parameters:
isCallerChecked - True if caller check has been done, false otherwise

getCallerChecked

  1. public boolean getCallerChecked( )
Returns if the caller check has been done or not.
Returns:
True if the caller check has been done, false otherwise

isReferenced

  1. public boolean isReferenced()
Returns if the token is referenced in the message or not.
Returns:
True if the token is referenced, false otherwise

setReferenced

  1. public void setReferenced(boolean isReferenced)
Sets whether the token is referenced in the message or not.
Parameters:
isReferenced - True if the token is referenced, false otherwise

getUsedTokenGenerator

  1. public TokenGeneratorConfig getUsedTokenGenerator( )
Returns the configuration of token generator. This method is used only at generator side.
Returns:
the token generator configuration

setUsedTokenGenerator

  1. public void setUsedTokenGenerator( TokenGeneratorConfig usedConfig)
Sets the configuration of token generator. This method is used only at generator side.
Parameters:
usedConfig - The token generator configuration

getUsedTokenConsumer

  1. public TokenConsumerConfig getUsedTokenConsumer( )
Returns the configuration of token consumer. This method is used only at consumer side.
Returns:
the token consumer configuration

setUsedTokenConsumer

  1. public void setUsedTokenConsumer( TokenConsumerConfig usedConfig)
Sets the configuration of token consumer. This method is used only at consumer side.
Parameters:
usedConfig - The token consumer configuration Protected by Java 2 Security permission com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.WSSToken.setUsedTokenConsumer")

isProcessed

  1. public boolean isProcessed()
Returns if the token is processed or not. This method is used only at consumer side.
Returns:
True if the token is processed, false otherwise

setProcessed

  1. public void setProcessed(boolean isProcessed)
Sets if the token is processed or not. This method is used only at consumer side.
Parameters:
isProcessed - True if the token is processed, false otherwise

getError

  1. public SoapSecurityException getError( )
Returns the error that occurs during token processing. This method is used only at consumer side.
Returns:
The SoapSecurityException that occured during token processing

setError

  1. public void setError(SoapSecurityException error)
Sets the error that occurs during token processing. This method is used only at consumer side.
Parameters:
error - The SoapSecurityException that occured during token processing

isReadOnly

  1. public boolean isReadOnly()

setReadOnly

  1. public void setReadOnly()
Description copied from interface: Token

When called, the token becomes irreversibly read-only. The implementation needs to ensure any setter methods check that this has been set.

Specified by:
setReadOnly in interface Token