Class PasswordChecker
java.lang.Object
com.netscape.cms.password.PasswordChecker
This class checks the given password if it meets the specific requirements.
For example, it can also specify the format of the password which has to
be 8 characters long and must be in alphanumeric.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PasswordChecker(int minSize, int minUpperLetter, int minLowerLetter, int minNumber, int minSpecialChar, int seqLength, int maxRepeatedChar, boolean cracklibCheck) -
Method Summary
Modifier and TypeMethodDescriptionintintintintintintReturns a reason if the password doesn't meet the quality requirement.Returns a reason if the password doesn't meet the quality requirement.intbooleanbooleanisGoodPassword(String pwd) Returns true if the given password meets the quality requirement; otherwise returns false.voidsetCracklibCheck(boolean cracklibCheck) voidsetMaxRepeatedChar(int maxRepeatedChar) voidsetMinLowerLetter(int minLowerLetter) voidsetMinNumber(int minNumber) voidsetMinSize(int minSize) voidsetMinSpecialChar(int minSpecialChar) voidsetMinUpperLetter(int minUpperLetter) voidsetSeqLength(int seqLength)
-
Constructor Details
-
PasswordChecker
public PasswordChecker()Default constructor. -
PasswordChecker
public PasswordChecker(int minSize, int minUpperLetter, int minLowerLetter, int minNumber, int minSpecialChar, int seqLength, int maxRepeatedChar, boolean cracklibCheck)
-
-
Method Details
-
isGoodPassword
Returns true if the given password meets the quality requirement; otherwise returns false.- Parameters:
pwd- The given password being checked.- Returns:
- true if the password meets the quality requirement; otherwise returns false.
- Throws:
EPasswordCheckException- If there is a configuration problem with the password checker
-
getReason
Returns a reason if the password doesn't meet the quality requirement.- Returns:
- string as a reason if the password quality requirement is not met.
-
getReason
-
getMinSize
public int getMinSize() -
setMinSize
public void setMinSize(int minSize) -
getMinUpperLetter
public int getMinUpperLetter() -
setMinUpperLetter
public void setMinUpperLetter(int minUpperLetter) -
getMinLowerLetter
public int getMinLowerLetter() -
setMinLowerLetter
public void setMinLowerLetter(int minLowerLetter) -
getMinNumber
public int getMinNumber() -
setMinNumber
public void setMinNumber(int minNumber) -
getMinSpecialChar
public int getMinSpecialChar() -
setMinSpecialChar
public void setMinSpecialChar(int minSpecialChar) -
getSeqLength
public int getSeqLength() -
setSeqLength
public void setSeqLength(int seqLength) -
getMaxRepeatedChar
public int getMaxRepeatedChar() -
setMaxRepeatedChar
public void setMaxRepeatedChar(int maxRepeatedChar) -
isCracklibCheck
public boolean isCracklibCheck() -
setCracklibCheck
public void setCracklibCheck(boolean cracklibCheck)
-