public class SecurePasswordHelper extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SECURE_PASSWORD_LENGTH
The default number of characters to generate for a secure password
|
static int |
DEFAULT_SECURE_PASSWORD_MIN_DIGITS
The default minimum number of digits to include when generating a secure password
|
static int |
DEFAULT_SECURE_PASSWORD_MIN_LOWERCASE_LETTERS
The default minimum number of lowercase letters to include when generating a secure password
|
static int |
DEFAULT_SECURE_PASSWORD_MIN_PUNCTUATION
The default minimum number of punctuation characters to include when generating a secure password
|
static int |
DEFAULT_SECURE_PASSWORD_MIN_UPPERCASE_LETTERS
The default minimum number of uppercase letters to include when generating a secure password
|
static int |
DEFAULT_SECURE_PASSWORD_MIN_WHITESPACE
The default minimum number of whitespace characters to include when generating a secure password
|
Constructor and Description |
---|
SecurePasswordHelper() |
Modifier and Type | Method and Description |
---|---|
String |
createSecurePassword()
Create a secure (random) password using a secure random number generator and a set of (reasonable)
characters.
|
String |
createSecurePassword(Integer length,
Integer minLowercaseLetters,
Integer minUppercaseLetters,
Integer minDigits,
Integer minPunctuation,
Integer minWhitespace)
Create a secure (random) password using a secure random number generator, a set of (reasonable)
characters, and meeting the specified rules.
|
public static final int DEFAULT_SECURE_PASSWORD_LENGTH
public static final int DEFAULT_SECURE_PASSWORD_MIN_LOWERCASE_LETTERS
public static final int DEFAULT_SECURE_PASSWORD_MIN_UPPERCASE_LETTERS
public static final int DEFAULT_SECURE_PASSWORD_MIN_DIGITS
public static final int DEFAULT_SECURE_PASSWORD_MIN_PUNCTUATION
public static final int DEFAULT_SECURE_PASSWORD_MIN_WHITESPACE
public String createSecurePassword()
createSecurePassword(Integer, Integer, Integer, Integer, Integer, Integer)
createSecurePassword(Integer, Integer, Integer, Integer, Integer, Integer)
public String createSecurePassword(Integer length, Integer minLowercaseLetters, Integer minUppercaseLetters, Integer minDigits, Integer minPunctuation, Integer minWhitespace)
null
, it's default value will be used:
length
- the required length of the generated passwordminLowercaseLetters
- the required minimum number of lowercase lettersminUppercaseLetters
- the required minimum number of uppercase lettersminDigits
- the required minimum number of digitsminPunctuation
- the required minimum number of punctuation charactersminWhitespace
- the required minimum number of space charactersCopyright © 2022 Apache Software Foundation. All rights reserved.