Class AbstractKeyInSessionCryptFactory<T extends org.apache.wicket.util.io.IClusterable>

java.lang.Object
org.apache.wicket.core.util.crypt.AbstractKeyInSessionCryptFactory<T>
Type Parameters:
T - the type for the secret key.
All Implemented Interfaces:
org.apache.wicket.util.crypt.ICryptFactory
Direct Known Subclasses:
KeyInSessionSunJceCryptFactory

public abstract class AbstractKeyInSessionCryptFactory<T extends org.apache.wicket.util.io.IClusterable> extends Object implements org.apache.wicket.util.crypt.ICryptFactory
Base class to implement crypt factories that store crypt into user session. Note that the use of this crypt factory will result in an immediate creation of a http session.
Author:
andrea del bene
  • Constructor Details

  • Method Details

    • newCrypt

      public org.apache.wicket.util.crypt.ICrypt newCrypt()
      Creates a new crypt for the current user session. If no user session is available, a new one is created.
      Specified by:
      newCrypt in interface org.apache.wicket.util.crypt.ICryptFactory
      Returns:
    • generateKey

      protected abstract T generateKey(Session session)
      Generates the secret key for a new crypt.
      Parameters:
      session - the current user session where crypt will be stored
      Returns:
      the secret key for a new crypt
    • createCrypt

      protected abstract org.apache.wicket.util.crypt.ICrypt createCrypt(T key)
      Returns:
      the ICrypt to use