Class PasswordUtil


  • public class PasswordUtil
    extends Object
    Util class for password.
    Since:
    1.0.0
    Author:
    imre.scheffer
    • Constructor Detail

      • PasswordUtil

        public PasswordUtil()
        Default constructor, constructs a new object.
    • Method Detail

      • encodeString

        public static String encodeString​(String string)
        Encodes given String to create password.
        Parameters:
        string - String to encode
        Returns:
        encoded password
      • isSame

        public static boolean isSame​(String string,
                                     String encodedString)
        Compares given raw and encoded Strings.
        Parameters:
        string - raw String to compare
        encodedString - encoded String to compare
        Returns:
        whether raw String is same as encoded
      • isStrong

        public static boolean isStrong​(String password)
        Checks if password is considered strong. A strong password is minimum 8 characters, contains at least 1 upper and 1 lower alpha, 1 numeric and 1 special character.
        Parameters:
        password - password to check
        Returns:
        true if password is strong, false otherwise