Class AbstractJceCrypt

  • All Implemented Interfaces:
    org.apache.wicket.util.crypt.ICrypt
    Direct Known Subclasses:
    AESCrypt

    public abstract class AbstractJceCrypt
    extends Object
    implements org.apache.wicket.util.crypt.ICrypt
    Base class for JCE based ICrypt implementations.
    • Method Detail

      • decryptUrlSafe

        public final String decryptUrlSafe​(String text)
        Decrypts a string into a string.
        Specified by:
        decryptUrlSafe in interface org.apache.wicket.util.crypt.ICrypt
        Parameters:
        text - text to decrypt
        Returns:
        the decrypted text
      • encryptUrlSafe

        public final String encryptUrlSafe​(String plainText)
        Encrypt a string into a string using URL safe Base64 encoding.
        Specified by:
        encryptUrlSafe in interface org.apache.wicket.util.crypt.ICrypt
        Parameters:
        plainText - text to encrypt
        Returns:
        encrypted string
      • decrypt

        protected abstract byte[] decrypt​(byte[] encrypted)
        Decrypts an encrypted byte array.
        Parameters:
        encrypted - byte array to decrypt
        Returns:
        the decrypted text
      • encrypt

        protected abstract byte[] encrypt​(byte[] plainBytes)
        Encrypts the given text into a byte array.
        Parameters:
        plainBytes - text to encrypt
        Returns:
        the string encrypted
      • setKey

        public final void setKey​(String key)
        Specified by:
        setKey in interface org.apache.wicket.util.crypt.ICrypt