Search in sources :

Example 1 with PasswordGenerator

use of org.passay.PasswordGenerator in project cia by Hack23.

the class UserRoleSystemTest method generatePassword.

private String generatePassword() {
    final List<CharacterRule> rules = Arrays.asList(new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1), new CharacterRule(EnglishCharacterData.Digit, 1), new CharacterRule(EnglishCharacterData.Special, 1));
    final PasswordGenerator generator = new PasswordGenerator();
    // Generated password is 12 characters long, which complies with policy
    return generator.generatePassword(12, rules);
}
Also used : PasswordGenerator(org.passay.PasswordGenerator) CharacterRule(org.passay.CharacterRule)

Aggregations

CharacterRule (org.passay.CharacterRule)1 PasswordGenerator (org.passay.PasswordGenerator)1