Package org.apache.myfaces.util.token
Class CsrfSessionTokenFactorySecureRandom
java.lang.Object
org.apache.myfaces.util.token.CsrfSessionTokenFactory
org.apache.myfaces.util.token.CsrfSessionTokenFactorySecureRandom
This factory generate a key composed by a counter and a random number. The
counter ensures uniqueness, and the random number prevents guess the next
session token.
- Since:
- 2.2
- Author:
- Leonardo Uribe
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Sets the random algorithm to initialize the secure random id generator.static final String
Sets the random class to initialize the secure random id generator.static final String
Sets the random provider to initialize the secure random id generator.Fields inherited from class org.apache.myfaces.util.token.CsrfSessionTokenFactory
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_LENGTH_PARAM, RANDOM_KEY_IN_CSRF_SESSION_TOKEN_LENGTH_PARAM_DEFAULT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateToken
(FacesContext context) protected byte[]
generateKey
(FacesContext facesContext)
-
Field Details
-
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_CLASS_PARAM
@JSFWebConfigParam(since="2.2.0", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_CLASS_PARAMSets the random class to initialize the secure random id generator. By default it uses java.security.SecureRandom- See Also:
-
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_PROVIDER_PARAM
@JSFWebConfigParam(since="2.2.0", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_PROVIDER_PARAMSets the random provider to initialize the secure random id generator.- See Also:
-
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_ALGORITM_PARAM
@JSFWebConfigParam(since="2.2.0", defaultValue="SHA1PRNG", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_ALGORITM_PARAMSets the random algorithm to initialize the secure random id generator. By default is SHA1PRNG- See Also:
-
-
Constructor Details
-
CsrfSessionTokenFactorySecureRandom
-
-
Method Details
-
generateKey
-
createToken
- Specified by:
createToken
in classCsrfSessionTokenFactory
-