Package fr.becpg.repo.authentication
Class SecurePasswordGenerator
java.lang.Object
fr.becpg.repo.authentication.SecurePasswordGenerator
Utility class that generates a random password using a cryptographically strong
random source (
SecureRandom).
The generated password has the following characteristics:
- Length: 14 characters.
- Contains at least one uppercase letter (
A-Z). - Contains at least one lowercase letter (
a-z). - Contains at least one digit (
0-9). - Contains at least one special character from:
!@#$%^&*()-_=+[]{}.
- Author:
- matthieu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringConstantALL="UPPER + LOWER + DIGIT + SPECIAL"private static final StringConstantDIGIT="0123456789"private static final StringConstantLOWER="abcdefghijklmnopqrstuvwxyz"private static final SecureRandomConstantRANDOMprivate static final StringConstantSPECIAL="!private static final StringConstantUPPER="ABCDEFGHIJKLMNOPQRSTUVWXYZ" -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstructor for SecurePasswordGenerator. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgeneratePassword.private static charrandomChar(String chars) randomChar.private static StringshuffleString(String input) shuffleString.
-
Field Details
-
RANDOM
ConstantRANDOM -
UPPER
ConstantUPPER="ABCDEFGHIJKLMNOPQRSTUVWXYZ"- See Also:
-
LOWER
ConstantLOWER="abcdefghijklmnopqrstuvwxyz"- See Also:
-
DIGIT
ConstantDIGIT="0123456789"- See Also:
-
SPECIAL
ConstantSPECIAL="!@#$%^&*()-_=+[]{}"- See Also:
-
ALL
ConstantALL="UPPER + LOWER + DIGIT + SPECIAL"- See Also:
-
-
Constructor Details
-
SecurePasswordGenerator
private SecurePasswordGenerator()Constructor for SecurePasswordGenerator.
-
-
Method Details