Class KeyInSessionSunJceCryptFactory

  • All Implemented Interfaces:
    org.apache.wicket.util.crypt.ICryptFactory

    public class KeyInSessionSunJceCryptFactory
    extends java.lang.Object
    implements org.apache.wicket.util.crypt.ICryptFactory
    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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.wicket.util.crypt.ICrypt createCrypt()  
      org.apache.wicket.util.crypt.ICrypt newCrypt()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyInSessionSunJceCryptFactory

        public KeyInSessionSunJceCryptFactory()
        Constructor using Cipher "PBEWithMD5AndDES"
      • KeyInSessionSunJceCryptFactory

        public KeyInSessionSunJceCryptFactory​(java.lang.String cryptMethod)
        Constructor that uses a custom Cipher
        Parameters:
        cryptMethod - the name of the crypt method (cipher)
    • Method Detail

      • newCrypt

        public org.apache.wicket.util.crypt.ICrypt newCrypt()
        Specified by:
        newCrypt in interface org.apache.wicket.util.crypt.ICryptFactory
      • createCrypt

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