Class 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
    • Method Detail

      • createCrypt

        @Deprecated(forRemoval=true)
        protected org.apache.wicket.util.crypt.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 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