public class

DefaultToken

extends Object
implements Token
java.lang.Object
   ↳ org.springframework.security.core.token.DefaultToken

Class Overview

The default implementation of Token.

Summary

Public Constructors
DefaultToken(String key, long keyCreationTime, String extendedInformation)
Public Methods
boolean equals(Object obj)
String getExtendedInformation()
Obtains the extended information associated within the token, which was presented when the token was first created.
String getKey()
Obtains the randomised, secure key assigned to this token.
long getKeyCreationTime()
The time the token key was initially created is available from this method.
int hashCode()
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.security.core.token.Token

Public Constructors

public DefaultToken (String key, long keyCreationTime, String extendedInformation)

Public Methods

public boolean equals (Object obj)

public String getExtendedInformation ()

Obtains the extended information associated within the token, which was presented when the token was first created.

Returns
  • the user-specified extended information, if any

public String getKey ()

Obtains the randomised, secure key assigned to this token. Presentation of this token to TokenService will always return a Token that is equal to the original Token issued for that key.

Returns
  • a key with appropriate randomness and security.

public long getKeyCreationTime ()

The time the token key was initially created is available from this method. Note that a given token must never have this creation time changed. If necessary, a new token can be requested from the TokenService to replace the original token.

Returns
  • the time this token key was created, in the same format as specified by getTime().

public int hashCode ()

public String toString ()