Class SimplePasswordStrengthChecker
- java.lang.Object
-
- org.jboss.as.domain.management.security.password.simple.SimplePasswordStrengthChecker
-
- All Implemented Interfaces:
PasswordStrengthChecker
public class SimplePasswordStrengthChecker extends Object implements PasswordStrengthChecker
- Author:
- baranowb
-
-
Field Summary
Fields Modifier and Type Field Description protected static intALPHA_ONLY_WEIGHTprotected static intALPHA_WEIGHTprotected static intCONSECUTIVE_ALPHA_WEIGHTprotected static intCONSECUTIVE_DIGITS_WEIGHTprotected static intCONSECUTIVE_SYMBOLS_WEIGHTprotected static intDICTIONARY_WORD_WEIGHTprotected static intDIGITS_ONLY_WEIGHTprotected static intDIGITS_WEIGHTprotected static intMIDDLE_NONCHAR_WEIGHTprotected static intPWD_LEN_WEIGHTstatic StringREGEX_ALPHAstatic StringREGEX_ALPHA_LCstatic StringREGEX_ALPHA_UCstatic StringREGEX_DIGITSstatic StringREGEX_SYMBOLSprotected static intREQUIREMENTS_WEIGHTprotected static intSEQUENTIAL_WEIGHTprotected static intSYMBOLS_WEIGHT
-
Constructor Summary
Constructors Constructor Description SimplePasswordStrengthChecker()SimplePasswordStrengthChecker(List<PasswordRestriction> initRestrictions, Dictionary dictionary, Keyboard keyboard)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PasswordStrengthCheckResultcheck(String userName, String password, List<PasswordRestriction> restictions)Determines password strength.protected voidcheckAlpha()protected voidcheckAlphaOnly()protected voidcheckConsecutiveAlpha()protected voidcheckConsecutiveNumbers()protected voidcheckConsecutiveSymbols()protected voidcheckDictionary()protected voidcheckDigits()protected voidcheckMiddleNonChar()protected voidcheckNumbersOnly()protected voidcheckRestrictions()protected voidcheckSequential()protected voidcheckSymbols()static PasswordRestrictiongetRestrictionAlpha(int minAlpha)static PasswordRestrictiongetRestrictionDigit(int minDigit)static PasswordRestrictiongetRestrictionSymbol(int minSymbol)
-
-
-
Field Detail
-
REGEX_DIGITS
public static final String REGEX_DIGITS
- See Also:
- Constant Field Values
-
REGEX_SYMBOLS
public static final String REGEX_SYMBOLS
- See Also:
- Constant Field Values
-
REGEX_ALPHA_UC
public static final String REGEX_ALPHA_UC
- See Also:
- Constant Field Values
-
REGEX_ALPHA_LC
public static final String REGEX_ALPHA_LC
- See Also:
- Constant Field Values
-
REGEX_ALPHA
public static final String REGEX_ALPHA
- See Also:
- Constant Field Values
-
PWD_LEN_WEIGHT
protected static final int PWD_LEN_WEIGHT
- See Also:
- Constant Field Values
-
REQUIREMENTS_WEIGHT
protected static final int REQUIREMENTS_WEIGHT
- See Also:
- Constant Field Values
-
SYMBOLS_WEIGHT
protected static final int SYMBOLS_WEIGHT
- See Also:
- Constant Field Values
-
DIGITS_WEIGHT
protected static final int DIGITS_WEIGHT
- See Also:
- Constant Field Values
-
MIDDLE_NONCHAR_WEIGHT
protected static final int MIDDLE_NONCHAR_WEIGHT
- See Also:
- Constant Field Values
-
ALPHA_WEIGHT
protected static final int ALPHA_WEIGHT
- See Also:
- Constant Field Values
-
ALPHA_ONLY_WEIGHT
protected static final int ALPHA_ONLY_WEIGHT
- See Also:
- Constant Field Values
-
DIGITS_ONLY_WEIGHT
protected static final int DIGITS_ONLY_WEIGHT
- See Also:
- Constant Field Values
-
CONSECUTIVE_ALPHA_WEIGHT
protected static final int CONSECUTIVE_ALPHA_WEIGHT
- See Also:
- Constant Field Values
-
CONSECUTIVE_DIGITS_WEIGHT
protected static final int CONSECUTIVE_DIGITS_WEIGHT
- See Also:
- Constant Field Values
-
CONSECUTIVE_SYMBOLS_WEIGHT
protected static final int CONSECUTIVE_SYMBOLS_WEIGHT
- See Also:
- Constant Field Values
-
DICTIONARY_WORD_WEIGHT
protected static final int DICTIONARY_WORD_WEIGHT
- See Also:
- Constant Field Values
-
SEQUENTIAL_WEIGHT
protected static final int SEQUENTIAL_WEIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimplePasswordStrengthChecker
public SimplePasswordStrengthChecker()
-
SimplePasswordStrengthChecker
public SimplePasswordStrengthChecker(List<PasswordRestriction> initRestrictions, Dictionary dictionary, Keyboard keyboard)
-
-
Method Detail
-
check
public PasswordStrengthCheckResult check(String userName, String password, List<PasswordRestriction> restictions)
Description copied from interface:PasswordStrengthCheckerDetermines password strength. Checks and algorithm are implementation specific.- Specified by:
checkin interfacePasswordStrengthChecker- Parameters:
userName- - The username the password is being specified for.password- - password which is going to be inspectedrestictions- - adhoc password restriction list. Those will be additionally checked against password.- Returns:
- result indicating strength of password and possible failure reasons.
-
checkRestrictions
protected void checkRestrictions()
-
checkSymbols
protected void checkSymbols()
-
checkDigits
protected void checkDigits()
-
checkMiddleNonChar
protected void checkMiddleNonChar()
-
checkAlpha
protected void checkAlpha()
-
checkAlphaOnly
protected void checkAlphaOnly()
-
checkNumbersOnly
protected void checkNumbersOnly()
-
checkConsecutiveAlpha
protected void checkConsecutiveAlpha()
-
checkConsecutiveNumbers
protected void checkConsecutiveNumbers()
-
checkConsecutiveSymbols
protected void checkConsecutiveSymbols()
-
checkSequential
protected void checkSequential()
-
checkDictionary
protected void checkDictionary()
-
getRestrictionAlpha
public static PasswordRestriction getRestrictionAlpha(int minAlpha)
-
getRestrictionDigit
public static PasswordRestriction getRestrictionDigit(int minDigit)
-
getRestrictionSymbol
public static PasswordRestriction getRestrictionSymbol(int minSymbol)
-
-