Specify a set of password requirements to check via checkPasswordStrength() More...
In the absence of a custom rule set, password strength checking operates on the basis of a minimum length of 6 characters, containing at least one upper case character and one digit.
A custom rule can be created in two ways:
Public Member Functions | |
int | getMinimumLength () |
Get the minimum length permitted. More... | |
int | getMaximumRepeat () |
Get the maximum number of occurrences permitted for any character. More... | |
boolean | getRequireUpper () |
Get the upper case requirement. More... | |
boolean | getRequireNumber () |
Get the numerical digit requirement. More... | |
boolean | getRequireSpecial () |
Get the requirement for a special character. More... | |
boolean | getPreventNumericSequence () |
Get whether a numerical sequence is permitted. More... | |
void | setPasswordStrengthParameters (int minLen, int maxRepeat, boolean hasNumber, boolean hasUpper, boolean hasSpecial, boolean hasNoSequence) |
Set all parameters in a single call. More... | |
PasswordStrengthRules | setMinimumLength (int length) |
Set the minimum length permitted. More... | |
PasswordStrengthRules | setRequireUpperCase (boolean isRequired) |
Set the upper case requirement. More... | |
PasswordStrengthRules | setRequireNumber (boolean isRequired) |
Set the numerical digit requirement. More... | |
PasswordStrengthRules | setRequireSpecialChar (boolean isRequired) |
Set the requirement for a special character. More... | |
PasswordStrengthRules | setMaximumRepeats (int num) |
Set the maximum number of occurrences for any character. More... | |
PasswordStrengthRules | setPreventNumericSequence (boolean isRequired) |
Set whether a numerical sequence is permitted. More... | |
int getMinimumLength | ( | ) |
Get the minimum password length permitted.
int getMaximumRepeat | ( | ) |
Get the maximum number of occurrences permitted for any character. The occurrences do not need to be consecutive.
boolean getRequireUpper | ( | ) |
Get the requirement for use of upper case letters.
boolean getRequireNumber | ( | ) |
Get the numerical digit requirement.
boolean getRequireSpecial | ( | ) |
Get the requirement for a special character. This will be any character recognized by ctype ispunct()
boolean getPreventNumericSequence | ( | ) |
Get whether a numerical sequence is permitted. A sequence could be ascending or descending.
void setPasswordStrengthParameters | ( | int | minLen, |
int | maxRepeat, | ||
boolean | hasNumber, | ||
boolean | hasUpper, | ||
boolean | hasSpecial, | ||
boolean | hasNoSequence | ||
) |
Set all parameters in a single call
PasswordStrengthRules setMinimumLength | ( | int | length | ) |
Set the minimum password length permitted.
PasswordStrengthRules setRequireUpperCase | ( | boolean | isRequired | ) |
Set if use of upper case letters is required in the password.
PasswordStrengthRules setRequireNumber | ( | boolean | isRequired | ) |
Set if a numerical digit is requried in the passsword.
PasswordStrengthRules setRequireSpecialChar | ( | boolean | isRequired | ) |
Set the requirement for a special character. This will be any character recognized by ctype ispunct()
PasswordStrengthRules setMaximumRepeats | ( | int | num | ) |
Set the maximum number of occurrences for any character. The occurrences do not need to be consecutive.
PasswordStrengthRules setPreventNumericSequence | ( | boolean | isRequired | ) |
Set whether a numerical sequence is permitted. A sequence could be ascending or descending.