Class PasswordUtil
java.lang.Object
com.ssgllc.fish.service.util.registered.PasswordUtil
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordUtil
(com.ssgllc.fish.service.cache.EntityConfigCacheService entityConfigCacheService) -
Method Summary
Modifier and TypeMethodDescriptionstatic com.ssgllc.fish.validation.ValidationResult
checkDictWord
(String password, String errorMessage) static com.ssgllc.fish.validation.ValidationResult
checkMinValidations
(Integer noOfValidationsToMatch, com.ssgllc.fish.validation.ValidationResult validation1, com.ssgllc.fish.validation.ValidationResult validation2, com.ssgllc.fish.validation.ValidationResult validation3, com.ssgllc.fish.validation.ValidationResult validation4, String errorMessage) static com.ssgllc.fish.validation.ValidationResult
checkNumberOfDigits
(Integer minDigitCount, String password, String errorMessage) Checks whether a password contains the required number of digits.static com.ssgllc.fish.validation.ValidationResult
checkNumberOfLowercase
(Integer minLowerCaseCount, String password, String errorMessage) Checks whether a password contains the required number of lowercase letters.static com.ssgllc.fish.validation.ValidationResult
checkNumberOfSpecial
(Integer minSepcialCharCount, String password, String errorMessage) Checks whether a password contains the required number of special characters.static com.ssgllc.fish.validation.ValidationResult
checkNumberOfUppercase
(Integer minUpperCaseCount, String password, String errorMessage) Checks whether a password contains the required number of uppercase letters.static com.ssgllc.fish.validation.ValidationResult
checkPasswordHistory
(Integer recentPassCount, String userId, String password, List<com.ssgllc.fish.domain.gen.User> userRevisions, String errorMessage) static com.ssgllc.fish.validation.ValidationResult
checkPasswordLength
(Integer minLength, Integer maxLength, String password, String errorMessage) Checks whether a password meets the minimum length requirement.static com.ssgllc.fish.validation.ValidationResult
checkRepeatCount
(Integer length, Integer count, String password, String errorMessage) Checks whether a password contains the required number of repeated characters.static com.ssgllc.fish.validation.ValidationResult
checkSequenceCount
(Integer minAcceptableSeq, String password, String errorMessage) Checks whether a password contains the required number of sequential characters.static void
-
Constructor Details
-
PasswordUtil
public PasswordUtil(com.ssgllc.fish.service.cache.EntityConfigCacheService entityConfigCacheService) throws org.springframework.beans.BeansException - Throws:
org.springframework.beans.BeansException
-
-
Method Details
-
checkPasswordLength
public static com.ssgllc.fish.validation.ValidationResult checkPasswordLength(Integer minLength, Integer maxLength, String password, String errorMessage) Checks whether a password meets the minimum length requirement.- Parameters:
minLength
- The minimum length required for the password.maxLength
- The maximum length allowed for the password.password
- The password to check.errorMessage
- The error message to display if the password is invalid.- Returns:
- A ValidationResult object indicating whether the password meets the length requirement.
-
checkNumberOfUppercase
public static com.ssgllc.fish.validation.ValidationResult checkNumberOfUppercase(Integer minUpperCaseCount, String password, String errorMessage) Checks whether a password contains the required number of uppercase letters.- Parameters:
minUpperCaseCount
- The minimum number of uppercase letters required for the password.password
- The password to check.errorMessage
- The error message to display if the password is invalid.- Returns:
- A ValidationResult object indicating whether the password meets the uppercase letter requirement.
-
checkNumberOfLowercase
public static com.ssgllc.fish.validation.ValidationResult checkNumberOfLowercase(Integer minLowerCaseCount, String password, String errorMessage) Checks whether a password contains the required number of lowercase letters.- Parameters:
minLowerCaseCount
- The minimum number of lowercase letters required for the password.password
- The password to check.errorMessage
- The error message to display if the password is invalid.- Returns:
- A ValidationResult object indicating whether the password meets the lowercase letter requirement.
-
checkNumberOfDigits
public static com.ssgllc.fish.validation.ValidationResult checkNumberOfDigits(Integer minDigitCount, String password, String errorMessage) Checks whether a password contains the required number of digits.- Parameters:
minDigitCount
- The minimum number of digits required for the password.password
- The password to check.errorMessage
- The error message to display if the password is invalid.- Returns:
- A ValidationResult object indicating whether the password meets the digit requirement.
-
checkNumberOfSpecial
public static com.ssgllc.fish.validation.ValidationResult checkNumberOfSpecial(Integer minSepcialCharCount, String password, String errorMessage) Checks whether a password contains the required number of special characters.- Parameters:
minSepcialCharCount
- The minimum number of special characters required for the password.password
- The password to check.errorMessage
- The error message to display if the password is invalid.- Returns:
- A ValidationResult object indicating whether the password meets the special character requirement.
-
checkSequenceCount
public static com.ssgllc.fish.validation.ValidationResult checkSequenceCount(Integer minAcceptableSeq, String password, String errorMessage) Checks whether a password contains the required number of sequential characters.- Parameters:
minAcceptableSeq
- The minimum number of sequential characters allowed in the password.password
- The password to check.errorMessage
- The error message to display if the password is invalid.- Returns:
- A ValidationResult object indicating whether the password meets the sequential character requirement.
-
checkRepeatCount
public static com.ssgllc.fish.validation.ValidationResult checkRepeatCount(Integer length, Integer count, String password, String errorMessage) Checks whether a password contains the required number of repeated characters.- Parameters:
length
- The length of the repeated character sequence.count
- The maximum number of allowed repeated sequences.password
- The password to check.errorMessage
- The error message to display if the password is invalid.- Returns:
- A ValidationResult object indicating whether the password meets the repeated character requirement.
-
checkPasswordHistory
-
createCommonWordsDictionary
public static void createCommonWordsDictionary() -
checkDictWord
-
checkMinValidations
public static com.ssgllc.fish.validation.ValidationResult checkMinValidations(Integer noOfValidationsToMatch, com.ssgllc.fish.validation.ValidationResult validation1, com.ssgllc.fish.validation.ValidationResult validation2, com.ssgllc.fish.validation.ValidationResult validation3, com.ssgllc.fish.validation.ValidationResult validation4, String errorMessage)
-