Class AbstractCrypt

    • Method Detail

      • encryptUrlSafe

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

        public String getKey()
        Get encryption private key
        Returns:
        encryption private key
      • setKey

        public void setKey​(String key)
        Set encryption private key
        Specified by:
        setKey in interface ICrypt
        Parameters:
        key - private key to make de-/encryption unique
      • crypt

        protected abstract byte[] crypt​(byte[] input,
                                        int mode)
                                 throws GeneralSecurityException
        Crypts the given byte array
        Parameters:
        input - byte array to be crypted
        mode - crypt mode
        Returns:
        the input crypted. Null in case of an error
        Throws:
        GeneralSecurityException