Class PasswordCheckUtil
- java.lang.Object
-
- org.jboss.as.domain.management.security.password.PasswordCheckUtil
-
public class PasswordCheckUtil extends Object
Simple util which narrows down password checks so there is no hassle in performing those checks in CLI.- Author:
- baranowb, Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description static String_PROPERTY_CHECKERstatic String_PROPERTY_FORBIDDENstatic String_PROPERTY_MATCH_USERNAMEstatic String_PROPERTY_MIN_ALPHAstatic String_PROPERTY_MIN_DIGITstatic String_PROPERTY_MIN_LENGTHstatic String_PROPERTY_MIN_SYMBOLstatic String_PROPERTY_RESTRICTIONstatic String_PROPERTY_STRENGTHList<PasswordRestriction>passwordValuesRestrictions
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PasswordCheckResultcheck(boolean isAdminitrative, String userName, String password)Method which performs strength checks on password.static PasswordCheckUtilcreate(File configFile)static PasswordCheckUtilcreate(RestrictionLevel level)PasswordRestrictioncreateAlphaRestriction(int minAlpha)PasswordRestrictioncreateDigitRestriction(int minDigit)voidcreateLengthRestriction(int minLength)PasswordRestrictioncreateSymbolRestriction(int minSymbol)List<PasswordRestriction>getPasswordRestrictions()RestrictionLevelgetRestrictionLevel()
-
-
-
Field Detail
-
_PROPERTY_CHECKER
public static final String _PROPERTY_CHECKER
- See Also:
- Constant Field Values
-
_PROPERTY_STRENGTH
public static final String _PROPERTY_STRENGTH
- See Also:
- Constant Field Values
-
_PROPERTY_FORBIDDEN
public static final String _PROPERTY_FORBIDDEN
- See Also:
- Constant Field Values
-
_PROPERTY_RESTRICTION
public static final String _PROPERTY_RESTRICTION
- See Also:
- Constant Field Values
-
_PROPERTY_MIN_LENGTH
public static final String _PROPERTY_MIN_LENGTH
- See Also:
- Constant Field Values
-
_PROPERTY_MIN_ALPHA
public static final String _PROPERTY_MIN_ALPHA
- See Also:
- Constant Field Values
-
_PROPERTY_MIN_DIGIT
public static final String _PROPERTY_MIN_DIGIT
- See Also:
- Constant Field Values
-
_PROPERTY_MIN_SYMBOL
public static final String _PROPERTY_MIN_SYMBOL
- See Also:
- Constant Field Values
-
_PROPERTY_MATCH_USERNAME
public static final String _PROPERTY_MATCH_USERNAME
- See Also:
- Constant Field Values
-
passwordValuesRestrictions
public List<PasswordRestriction> passwordValuesRestrictions
-
-
Method Detail
-
create
public static PasswordCheckUtil create(File configFile)
-
create
public static PasswordCheckUtil create(RestrictionLevel level)
-
check
public PasswordCheckResult check(boolean isAdminitrative, String userName, String password)
Method which performs strength checks on password. It returns outcome which can be used by CLI.- Parameters:
isAdminitrative- - administrative checks are less restrictive. This means that weak password or one which violates restrictions is not indicated as failure. Administrative checks are usually performed by admin changing/setting default password for user.userName- - the name of user for which password is set.password- - password.- Returns:
-
getRestrictionLevel
public RestrictionLevel getRestrictionLevel()
-
getPasswordRestrictions
public List<PasswordRestriction> getPasswordRestrictions()
-
createLengthRestriction
public void createLengthRestriction(int minLength)
-
createAlphaRestriction
public PasswordRestriction createAlphaRestriction(int minAlpha)
-
createDigitRestriction
public PasswordRestriction createDigitRestriction(int minDigit)
-
createSymbolRestriction
public PasswordRestriction createSymbolRestriction(int minSymbol)
-
-