Class BasicEncryption

    • Constructor Detail

      • BasicEncryption

        public BasicEncryption​(Map<String,​String> params)
    • Method Detail

      • encryptPassword

        public String encryptPassword​(String password)
        Description copied from interface: Encryption
        Encrypt a password.
        Specified by:
        encryptPassword in interface Encryption
        Parameters:
        password - the password in plain format.
        Returns:
        the encrypted password format.
      • checkPassword

        public boolean checkPassword​(String provided,
                                     String real)
        Description copied from interface: Encryption
        Check password.
        Specified by:
        checkPassword in interface Encryption
        Parameters:
        provided - password provided in plain format.
        real - the encrypted format to compare with.
        Returns:
        true if the password match, false else.
      • hexEncode

        public static String hexEncode​(byte[] in)
      • base64Encode

        public static String base64Encode​(byte[] input)
        Encode the input data producing a base 64 encoded byte array.
        Parameters:
        input - the String to encore as an array of byte.
        Returns:
        a byte array containing the base 64 encoded data.