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 produces
Note that the use of this crypt factory will result in an immediate creation of a session.
SunJceCrypt
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
ConstructorDescriptionConstructor usingCipher
"PBEWithMD5AndDES"KeyInSessionSunJceCryptFactory
(String cryptMethod) Constructor that uses a customCipher
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
KeyInSessionSunJceCryptFactory
public KeyInSessionSunJceCryptFactory()Constructor usingCipher
"PBEWithMD5AndDES" -
KeyInSessionSunJceCryptFactory
Constructor that uses a customCipher
- Parameters:
cryptMethod
- the name of the crypt method (cipher)
-
-
Method Details
-
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
-