public interface PasswordPolicy
PasswordPolicy
defines how a valid password looks like, is able to create such a password and to check
whether a given character-sequence is a valid password according to the requirements.Modifier and Type | Interface and Description |
---|---|
static class |
PasswordPolicy.ValidationResult
Holds the result of validating a password.
|
Modifier and Type | Field and Description |
---|---|
static String |
LOWERCASE
lowercase letters a-z
|
static String |
NUMBER
numbers 0-9
|
static String |
PUNCT
punctuation characters !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
static String |
UPPERCASE
uppercase letters A-Z
|
Modifier and Type | Method and Description |
---|---|
default void |
configure(Properties platformProperties)
Configures the
PasswordPolicy |
String |
generatePassword()
Generates a new random password that matches the requirements and returns it.
|
String |
getErrorMessageKey()
Deprecated.
a
PasswordPolicy.ValidationResult should be used, see validatePassword(String, char[], char[]) |
boolean |
isValidPassword(char[] password)
Deprecated.
will be removed in 2.x, use
validatePassword(String, char[], char[]) instead |
default PasswordPolicy.ValidationResult |
validatePassword(String username,
char[] currentPassword,
char[] password)
Validates the password an returns a
PasswordPolicy.ValidationResult |
static final String NUMBER
static final String LOWERCASE
static final String UPPERCASE
static final String PUNCT
default void configure(Properties platformProperties)
PasswordPolicy
platformProperties
- the platform's Properties
@Deprecated boolean isValidPassword(char[] password)
validatePassword(String, char[], char[])
insteadpassword
- the character-sequence sequence to checktrue
if the character-sequence is a valid password, false
otherwisedefault PasswordPolicy.ValidationResult validatePassword(String username, char[] currentPassword, char[] password)
PasswordPolicy.ValidationResult
username
- the username (can be null
)currentPassword
- the current password (can be null
)password
- the new password (must not be null
)@Deprecated String getErrorMessageKey()
PasswordPolicy.ValidationResult
should be used, see validatePassword(String, char[], char[])
String generatePassword()
Copyright © 2011–2023 aiticon GmbH. All rights reserved.