java.lang.Object
rodeo.password.pgencheck.PasswordMaker
Create passwords according to predefined criteria.
The following criteria are available:
- length;
-
constraints on characters composing the password:
- character must belong to a predefined group of characters;
- minimum and maximum number of characters per group can be specified;
-
the way random numbers are used in password generation can be configured by implementing a
RandomUIntGenerator.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classInternal factory to createPasswordMakers. -
Method Summary
Modifier and TypeMethodDescriptioncreate()Generate a new password.static PasswordMaker.Factoryfactory()Create a factory to specify password generation criteria and create aPasswordMakerobject.Return all characters used in generating password.getCharacterGroup(int index) Return the nth character group used in creating passwords.intReturns how many character groups are used in composing passwords.Returns a list of the character groups composing the generated passwords.intReturns the specified length for generated passwords.intgetMaxCharactersInGroup(int index) Return the maximum number of characters from the nth character group allowed in generated passwords.intgetMinCharactersInGroup(int index) Return how many characters from the nth character group are required in generated passwords.Returns the implementation of the random number generator used to create passwords.
-
Method Details
-
factory
Create a factory to specify password generation criteria and create aPasswordMakerobject.- Returns:
- an internal
PasswordMakerfactory - See Also:
-
getLength
public int getLength()Returns the specified length for generated passwords.- Returns:
- the specified length for generated passwords
-
getRandomUIntGenerator
Returns the implementation of the random number generator used to create passwords.- Returns:
- the implementation of the random number generator used to create passwords
- See Also:
-
create
Generate a new password.- Returns:
- the generated password
-
getCharacterGroups
Returns a list of the character groups composing the generated passwords.- Returns:
- the character groups
-
getCharacterGroupCount
public int getCharacterGroupCount()Returns how many character groups are used in composing passwords.- Returns:
- character group count
-
getCharacterGroup
Return the nth character group used in creating passwords. Character groups are referenced in the order they are added to the factory. The first index is0(zero).- Parameters:
index- of the character group to retrieve- Returns:
- the character group at the
index - Throws:
IndexOutOfBoundsException- if theindexis invalid
-
getMinCharactersInGroup
public int getMinCharactersInGroup(int index) Return how many characters from the nth character group are required in generated passwords. Character groups are referenced in the order they were added to the factory. The first index is0(zero).- Parameters:
index- of the character group minimum count to retrieve- Returns:
- the minimum number of characters from the group at the
indexrequired to form a valid password - Throws:
IndexOutOfBoundsException- if theindexis invalid
-
getMaxCharactersInGroup
public int getMaxCharactersInGroup(int index) Return the maximum number of characters from the nth character group allowed in generated passwords. Character groups are referenced in the order they were added to the factory. The first index is0(zero).- Parameters:
index- of the character group maximum count to retrieve- Returns:
- the maximum number of characters from the group at the
indexallowed in a valid password - Throws:
IndexOutOfBoundsException- if theindexis invalid
-
getAllChars
Return all characters used in generating password.- Returns:
- characters used in generating password
-