public class PasswordCheckUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
_PROPERTY_CHECKER |
static String |
_PROPERTY_FORBIDDEN |
static String |
_PROPERTY_MATCH_USERNAME |
static String |
_PROPERTY_MIN_ALPHA |
static String |
_PROPERTY_MIN_DIGIT |
static String |
_PROPERTY_MIN_LENGTH |
static String |
_PROPERTY_MIN_SYMBOL |
static String |
_PROPERTY_RESTRICTION |
static String |
_PROPERTY_STRENGTH |
List<PasswordRestriction> |
passwordValuesRestrictions |
Modifier and Type | Method and Description |
---|---|
PasswordCheckResult |
check(boolean isAdminitrative,
String userName,
String password)
Method which performs strength checks on password.
|
static PasswordCheckUtil |
create(File configFile) |
static PasswordCheckUtil |
create(RestrictionLevel level) |
PasswordRestriction |
createAlphaRestriction(int minAlpha) |
PasswordRestriction |
createDigitRestriction(int minDigit) |
void |
createLengthRestriction(int minLength) |
PasswordRestriction |
createSymbolRestriction(int minSymbol) |
List<PasswordRestriction> |
getPasswordRestrictions() |
RestrictionLevel |
getRestrictionLevel() |
public static final String _PROPERTY_CHECKER
public static final String _PROPERTY_STRENGTH
public static final String _PROPERTY_FORBIDDEN
public static final String _PROPERTY_RESTRICTION
public static final String _PROPERTY_MIN_LENGTH
public static final String _PROPERTY_MIN_ALPHA
public static final String _PROPERTY_MIN_DIGIT
public static final String _PROPERTY_MIN_SYMBOL
public static final String _PROPERTY_MATCH_USERNAME
public List<PasswordRestriction> passwordValuesRestrictions
public static PasswordCheckUtil create(File configFile)
public static PasswordCheckUtil create(RestrictionLevel level)
public PasswordCheckResult check(boolean isAdminitrative, String userName, String password)
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.public RestrictionLevel getRestrictionLevel()
public List<PasswordRestriction> getPasswordRestrictions()
public void createLengthRestriction(int minLength)
public PasswordRestriction createAlphaRestriction(int minAlpha)
public PasswordRestriction createDigitRestriction(int minDigit)
public PasswordRestriction createSymbolRestriction(int minSymbol)
Copyright © 2023 JBoss by Red Hat. All rights reserved.