Class DefaultToken
- java.lang.Object
-
- org.springframework.security.core.token.DefaultToken
-
-
Constructor Summary
Constructors Constructor Description DefaultToken(java.lang.String key, long keyCreationTime, java.lang.String extendedInformation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getExtendedInformation()
Obtains the extended information associated within the token, which was presented when the token was first created.java.lang.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()
java.lang.String
toString()
-
-
-
Method Detail
-
getKey
public java.lang.String getKey()
Description copied from interface:Token
Obtains the randomised, secure key assigned to this token. Presentation of this token toTokenService
will always return aToken
that is equal to the originalToken
issued for that key.
-
getKeyCreationTime
public long getKeyCreationTime()
Description copied from interface:Token
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 theTokenService
to replace the original token.- Specified by:
getKeyCreationTime
in interfaceToken
- Returns:
- the time this token key was created, in the same format as specified by
Date.getTime()
.
-
getExtendedInformation
public java.lang.String getExtendedInformation()
Description copied from interface:Token
Obtains the extended information associated within the token, which was presented when the token was first created.- Specified by:
getExtendedInformation
in interfaceToken
- Returns:
- the user-specified extended information, if any
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-