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:
org.apache.wicket.util.crypt.ICryptFactory

public class KeyInSessionSunJceCryptFactory extends AbstractKeyInSessionCryptFactory<org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData>
Crypt factory that produces 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 Details

  • 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 class AbstractKeyInSessionCryptFactory<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 org.apache.wicket.util.crypt.ICrypt createCrypt(org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData keyParams)
      Specified by:
      createCrypt in class AbstractKeyInSessionCryptFactory<org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory.CryptData>
      Returns:
      the ICrypt to use