Class PasswordUtils


  • public final class PasswordUtils
    extends Object
    This class provides several helper methods for assuring password quality.
    • Constructor Detail

      • PasswordUtils

        public PasswordUtils()
    • Method Detail

      • getBlacklist

        public static List<String> getBlacklist​(Entity... entities)
        Gets a list of excluded words, that are values of specific attributes of the designated entities. For instance, the values of "lastName" or must not be used.
        Parameters:
        entities - The entities providing the attribute values disallowed as password.
        Returns:
        A list of words that should not be used as password for the designated entities.
      • getPasswordStrength

        public static String getPasswordStrength​(Locale locale,
                                                 int score,
                                                 String password)
        Get the localised password strength, from weak to strong.
        Parameters:
        locale - The locale to be used.
        score - The password score that should be translated into the password strength expression. Integer.MIN_VALUE is for undefined strength.
        password - The password to get the strength for.
        Returns:
        The password strength.