• BlackBerry Spark AppSecure
  • Security library for Android applications
  • 0.7.915.0
PasswordStrengthRules Class Reference

Specify a set of password requirements to check via checkPasswordStrength() More...

Description

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...
 

Member Function Documentation

◆ getMinimumLength()

int getMinimumLength ( )

Get the minimum password length permitted.

◆ getMaximumRepeat()

int getMaximumRepeat ( )

Get the maximum number of occurrences permitted for any character. The occurrences do not need to be consecutive.

◆ getRequireUpper()

boolean getRequireUpper ( )

Get the requirement for use of upper case letters.

◆ getRequireNumber()

boolean getRequireNumber ( )

Get the numerical digit requirement.

◆ getRequireSpecial()

boolean getRequireSpecial ( )

Get the requirement for a special character. This will be any character recognized by ctype ispunct()

◆ getPreventNumericSequence()

boolean getPreventNumericSequence ( )

Get whether a numerical sequence is permitted. A sequence could be ascending or descending.

◆ setPasswordStrengthParameters()

void setPasswordStrengthParameters ( int  minLen,
int  maxRepeat,
boolean  hasNumber,
boolean  hasUpper,
boolean  hasSpecial,
boolean  hasNoSequence 
)

Set all parameters in a single call

◆ setMinimumLength()

PasswordStrengthRules setMinimumLength ( int  length)

Set the minimum password length permitted.

◆ setRequireUpperCase()

PasswordStrengthRules setRequireUpperCase ( boolean  isRequired)

Set if use of upper case letters is required in the password.

◆ setRequireNumber()

PasswordStrengthRules setRequireNumber ( boolean  isRequired)

Set if a numerical digit is requried in the passsword.

◆ setRequireSpecialChar()

PasswordStrengthRules setRequireSpecialChar ( boolean  isRequired)

Set the requirement for a special character. This will be any character recognized by ctype ispunct()

◆ setMaximumRepeats()

PasswordStrengthRules setMaximumRepeats ( int  num)

Set the maximum number of occurrences for any character. The occurrences do not need to be consecutive.

◆ setPreventNumericSequence()

PasswordStrengthRules setPreventNumericSequence ( boolean  isRequired)

Set whether a numerical sequence is permitted. A sequence could be ascending or descending.