com.ibm.wsspi.wssecurity.auth.token
Class LTPAToken

java.lang.Object
  extended bycom.ibm.wsspi.wssecurity.auth.token.WSSToken
      extended bycom.ibm.wsspi.wssecurity.auth.token.LTPAToken
All Implemented Interfaces:
java.lang.Cloneable, com.ibm.wsspi.security.token.PropagationToken, Token, com.ibm.wsspi.security.token.Token

public class LTPAToken
extends WSSToken

This class is a token object implementation for LTPA tokens. It extends the WSSToken class, which implements the Token class. It will typically be created by the LTPATokenGenerator and process by the LTPATokenConsumer.

See Also:
WSSToken, Token

Nested Class Summary
 
Nested classes inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
WSSToken.AttributesEnumerator
 
Field Summary
 
Fields inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
_attributes, _callerChecked, _error, _keyInfoType, _processed, _referenced, _tokenelem, _tokenId, _trusted, _usedTokenConsumer, _usedTokenGenerator, _usedToLogin, _version, _vtype
 
Constructor Summary
LTPAToken(java.lang.String tokenId, byte[] cred)
          Constructor
LTPAToken(java.lang.String tokenId, byte[] cred, java.lang.String username, char[] password, org.w3c.dom.Element elem)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object o)
           
 byte[] getBytes()
          Returns the credential binary data of the LTPA token.
 long getExpiration()
          Returns the expiration of the credential.
 java.lang.String getPrincipal()
          Returns the username if set, otherwise null.
 java.lang.String getUniqueID()
           
 int hashCode()
           
 boolean isValid()
          Returns if the token is valid or not.
 void setBytes(byte[] cred)
          Sets the credential binary data of the LTPA token.
 void setReadOnly()
           
 java.lang.String toString()
           
 
Methods inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
addAttribute, clone, getAttributeNames, getAttributes, getCallerChecked, getElement, getError, getId, getKeyInfoType, getName, getType, getUsedTokenConsumer, getUsedTokenGenerator, getUsedToLogin, getVersion, isForwardable, isProcessed, isReferenced, isTrusted, setCallerChecked, setElement, setError, setId, setKeyInfoType, setProcessed, setReferenced, setTrusted, setType, setType, setUsedTokenConsumer, setUsedTokenGenerator, setUsedToLogin
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LTPAToken

public LTPAToken(java.lang.String tokenId,
                 byte[] cred,
                 java.lang.String username,
                 char[] password,
                 org.w3c.dom.Element elem)
Constructor

Parameters:
tokenId - The token identifier
cred - A byte[] containing the credential
username - The username string; may be null if there is no username
password - The password as a char[]; may be null if there is no password
elem - A token element; may be null if there is no token element

LTPAToken

public LTPAToken(java.lang.String tokenId,
                 byte[] cred)
Constructor

Parameters:
cred - A byte[] containing the credential
Method Detail

setBytes

public void setBytes(byte[] cred)
Sets the credential binary data of the LTPA token.

Parameters:
cred - The credential in the form of a byte[]

getBytes

public byte[] getBytes()
Returns the credential binary data of the LTPA token.

Specified by:
getBytes in interface com.ibm.wsspi.security.token.Token
Overrides:
getBytes in class WSSToken
Returns:
The credential binary data as a byte[]

isValid

public boolean isValid()
Returns if the token is valid or not.

Returns:
True is valid, false otherwise
See Also:
Token.isValid()

getExpiration

public long getExpiration()
Returns the expiration of the credential.

Returns:
The credential expiration as a long
See Also:
Token.getExpiration()

getPrincipal

public java.lang.String getPrincipal()
Returns the username if set, otherwise null.

Returns:
The username
See Also:
Token.getPrincipal()

getUniqueID

public java.lang.String getUniqueID()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)

setReadOnly

public void setReadOnly()

toString

public java.lang.String toString()