Package org.jclouds.util
Class PasswordGenerator
java.lang.Object
org.jclouds.util.PasswordGenerator
Generates random passwords.
This class allows to configure the password requirements for:
- Number of upper case and lower case letters
- Inclusion of numbers
- Inclusion of special characters
It also allows to configure forbidden characters to accommodate the password requirements for the different clouds.
Example usage:
String password = new PasswordGenerator() .lower().count(3) // Exactly three lower case characters .upper().count(2) // Exactly 2 upper case characters .numbers().min(5).exclude("012345".toCharArray()) // At least five numbers, from 6 to 9. .symbols().min(6).max(10) // Between 6 and 10 special characters .generate();
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PasswordGenerator
public PasswordGenerator()
-
-
Method Details
-
lower
Returns the lower case configuration. Allows to configure the presence of lower case characters. -
upper
Returns the upper case configuration. Allows to configure the presence of upper case characters. -
numbers
Returns the numbers configuration. Allows to configure the presence of numeric characters. -
symbols
Returns the special character configuration. Allows to configure the presence of special characters. -
generate
Generates a random password using the configured spec.
-