Package org.cyclos.impl.utils
Class PasswordHelper
- java.lang.Object
-
- org.cyclos.impl.utils.PasswordHelper
-
public class PasswordHelper extends Object
Helper methods for process and validate passwords
-
-
Field Summary
Fields Modifier and Type Field Description static intSPLIT_PASSWORD_LENGTHstatic StringSPLIT_PASSWORD_SEPARATORstatic StringSPLIT_SEQUENCE_SEPARATOR
-
Constructor Summary
Constructors Constructor Description PasswordHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>generateVirtualKeyboardSequence(PasswordType passwordType, String passwordValue)Generates a valid virtual keyboard sequence for the given password type, and current password value.static booleanisTooObvious(String value, Collection<String> forbidden)Check if the given password value is too obvious to be accepted
-
-
-
Field Detail
-
SPLIT_PASSWORD_LENGTH
public static final int SPLIT_PASSWORD_LENGTH
- See Also:
- Constant Field Values
-
SPLIT_PASSWORD_SEPARATOR
public static final String SPLIT_PASSWORD_SEPARATOR
- See Also:
- Constant Field Values
-
SPLIT_SEQUENCE_SEPARATOR
public static final String SPLIT_SEQUENCE_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateVirtualKeyboardSequence
public static List<String> generateVirtualKeyboardSequence(PasswordType passwordType, String passwordValue)
Generates a valid virtual keyboard sequence for the given password type, and current password value. If a current password is given, it is guaranteed that the password chars will be contained on each sequence, allowing more possible characters than the limit of buttons * chars per button. If the current password is null, that limit must be respected. If the password type's input method is notPasswordInputMethod.VIRTUAL_KEYBOARD, returns null.
-
isTooObvious
public static boolean isTooObvious(String value, Collection<String> forbidden) throws ValidationException
Check if the given password value is too obvious to be accepted- Throws:
ValidationException
-
-