Package fr.becpg.repo.authentication
Class PasswordStrengthRule
java.lang.Object
fr.becpg.repo.authentication.PasswordStrengthRule
Security policy every password must match, whether generated or typed by the user: at least
14 characters, one uppercase letter, one lowercase letter, one digit and one special character.
A special character is any visible ASCII character that is neither a letter nor a digit, so the
policy does not depend on the alphabet SecurePasswordGenerator draws from.
- Author:
- valentin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final charprivate static final charprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleanisSatisfiedBy(String password) Tells whether the password matches the security policy.private static booleanisSpecial(int character)
-
Field Details
-
MIN_LENGTH
private static final int MIN_LENGTH- See Also:
-
FIRST_VISIBLE_ASCII
private static final char FIRST_VISIBLE_ASCII- See Also:
-
LAST_VISIBLE_ASCII
private static final char LAST_VISIBLE_ASCII- See Also:
-
-
Constructor Details
-
PasswordStrengthRule
private PasswordStrengthRule()
-
-
Method Details
-
isSatisfiedBy
Tells whether the password matches the security policy.- Parameters:
password- the password to check, may be null- Returns:
- true if the password matches the policy
-
isSpecial
private static boolean isSpecial(int character)
-