Class KeyInSessionSunJceCryptFactory
- java.lang.Object
-
- org.apache.wicket.core.util.crypt.AbstractKeyInSessionCryptFactory<org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData>
-
- org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory
-
- All Implemented Interfaces:
ICryptFactory
public class KeyInSessionSunJceCryptFactory extends AbstractKeyInSessionCryptFactory<org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData>
Crypt factory that producesSunJceCrypt
instances based on session-specific encryption key. This allows each user to have his own encryption key, hardening against CSRF attacks.
Note that the use of this crypt factory will result in an immediate creation of a session.- Author:
- igor.vaynberg
-
-
Constructor Summary
Constructors Constructor Description KeyInSessionSunJceCryptFactory()
Constructor usingCipher
"PBEWithMD5AndDES"KeyInSessionSunJceCryptFactory(String cryptMethod)
Constructor that uses a customCipher
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ICrypt
createCrypt()
Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer called TODO remove in Wicket 10protected ICrypt
createCrypt(org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData keyParams)
protected org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData
generateKey(Session session)
Generates the secret key for a new crypt.-
Methods inherited from class org.apache.wicket.core.util.crypt.AbstractKeyInSessionCryptFactory
newCrypt
-
-
-
-
Constructor Detail
-
KeyInSessionSunJceCryptFactory
public KeyInSessionSunJceCryptFactory()
Constructor usingCipher
"PBEWithMD5AndDES"
-
KeyInSessionSunJceCryptFactory
public KeyInSessionSunJceCryptFactory(String cryptMethod)
Constructor that uses a customCipher
- Parameters:
cryptMethod
- the name of the crypt method (cipher)
-
-
Method Detail
-
createCrypt
@Deprecated(forRemoval=true) protected ICrypt createCrypt()
Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer called TODO remove in Wicket 10- Returns:
- the
ICrypt
to use
-
generateKey
protected org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData generateKey(Session session)
Description copied from class:AbstractKeyInSessionCryptFactory
Generates the secret key for a new crypt.- Specified by:
generateKey
in classAbstractKeyInSessionCryptFactory<org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData>
- Parameters:
session
- the current user session where crypt will be stored- Returns:
- the secret key for a new crypt
-
createCrypt
protected ICrypt createCrypt(org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData keyParams)
- Specified by:
createCrypt
in classAbstractKeyInSessionCryptFactory<org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData>
- Returns:
- the
ICrypt
to use
-
-