Class SynchronizerTokenGenerator
- java.lang.Object
-
- org.silverpeas.core.security.token.synchronizer.SynchronizerTokenGenerator
-
- All Implemented Interfaces:
TokenGenerator
public class SynchronizerTokenGenerator extends Object implements TokenGenerator
A generator of synchronizer tokens. The generation of the token is based upon a random key and the generation can be altered by passing it some input parameters.
-
-
Constructor Summary
Constructors Constructor Description SynchronizerTokenGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SynchronizerToken
generate(TokenGenerationParameter... parameters)
Generates a new token by taking into account any of the specified generation parameters.<T extends Token>
Trenew(T token)
Renews the specified token.
-
-
-
Method Detail
-
generate
public SynchronizerToken generate(TokenGenerationParameter... parameters)
Generates a new token by taking into account any of the specified generation parameters. The parameters are used to alter the generation of the token. If no parameters are passed, then the token is only generated from a random value.- Specified by:
generate
in interfaceTokenGenerator
- Parameters:
parameters
- the parameter for adding entropy in the token generation. Only String-value parameters are taken into account.- Returns:
- a new token. The length of the token is at least of 48 characters. It can be more longer by passing parameters with a value of more than 48 characters.
-
renew
public <T extends Token> T renew(T token)
Renews the specified token. The token value will be regenerated.- Specified by:
renew
in interfaceTokenGenerator
- Type Parameters:
T
- the concrete type of the token to renew.- Parameters:
token
- the token to renew.- Returns:
- the renewed token.
-
-