com.ibm.wsspi.security.ltpa
Interface Token

All Superinterfaces:
java.lang.Cloneable

public interface Token
extends java.lang.Cloneable

This interface is implemented by a provider to define the behavior of the LTPA token. The TokenFactory implementation should handle loading the Token implementation.


Method Summary
 java.lang.String[] addAttribute(java.lang.String key, java.lang.String value)
           Adds the attribute name/value pair to a String[] list of values for the specified key.
 java.lang.Object clone()
          Makes a deep copy of this token when necessary
 java.util.Enumeration getAttributeNames()
          Gets the attribute names
 java.lang.String[] getAttributes(java.lang.String key)
           Gets the attribute value based on the named value.
 byte[] getBytes()
          Gets the encrypted bytes for inclusion in the WSCredential or SSO cookie.
 long getExpiration()
          Gets the expiration as a long.
 short getVersion()
          Gets the version of the token as an short.
 boolean isValid()
          Validates the token including expiration, signature, etc.
 

Method Detail

isValid

public boolean isValid()
                throws InvalidTokenException,
                       TokenExpiredException
Validates the token including expiration, signature, etc.

Returns:
boolean
Throws:
InvalidTokenException
TokenExpiredException

getBytes

public byte[] getBytes()
                throws InvalidTokenException,
                       TokenExpiredException
Gets the encrypted bytes for inclusion in the WSCredential or SSO cookie.

Returns:
byte[]
Throws:
InvalidTokenException
TokenExpiredException

getExpiration

public long getExpiration()
Gets the expiration as a long.

Returns:
long

getVersion

public short getVersion()
Gets the version of the token as an short.

Returns:
short

getAttributes

public java.lang.String[] getAttributes(java.lang.String key)

Gets the attribute value based on the named value. A string array is returned containing all values of the attribute previously set.

Returns:
String[]

addAttribute

public java.lang.String[] addAttribute(java.lang.String key,
                                       java.lang.String value)

Adds the attribute name/value pair to a String[] list of values for the specified key. Once an attribute is set, it cannot only be appended to but not overwritten. Returns the previous value(s) set for key, not including the current value being set, or null if not previously set.

Returns:
String[]

getAttributeNames

public java.util.Enumeration getAttributeNames()
Gets the attribute names

Returns:
java.lang.Enumeration

clone

public java.lang.Object clone()
Makes a deep copy of this token when necessary

Returns:
Object