public final class PasswordMeter extends java.lang.Object implements Scriptable
| Constructor and Description |
|---|
PasswordMeter()
Creates a new password meter using the default built-in configuration.
|
PasswordMeter(PasswordConfig config)
Creates a new password meter using the default configuration
|
| Modifier and Type | Method and Description |
|---|---|
PasswordConfig |
configuration()
Returns the configuration used by this password meter.
|
java.lang.String |
getLevel(java.lang.String password)
Evaluate the specified password.
|
boolean |
isAtLeast(java.lang.String password,
java.lang.String level)
Indicates whether the specified password matches at least the supplied level.
|
static void |
main(java.lang.String[] args) |
int |
score(java.lang.String password)
Returns the score for this password.
|
java.lang.Appendable |
toScript(java.lang.Appendable script)
Writes the script for the object on to the specified writer.
|
int[] |
vector(java.lang.String password)
Returns the vector of scores for each rule in the order in which they are defined.
|
public PasswordMeter()
public PasswordMeter(PasswordConfig config)
java.lang.NullPointerException - if the configuration is not specified.public java.lang.String getLevel(java.lang.String password)
public int[] vector(java.lang.String password)
password - the password to evaluatepublic int score(java.lang.String password)
public boolean isAtLeast(java.lang.String password,
java.lang.String level)
password - The password to evaluate.level - The level that must be matched.true if the score is sufficient to match at least this level;
false otherwise.java.lang.IllegalArgumentException - If the level is not defined in the config.java.lang.NullPointerException - If the level is null.public PasswordConfig configuration()
public java.lang.Appendable toScript(java.lang.Appendable script)
throws java.io.IOException
ScriptabletoScript in interface Scriptablescript - Where to write the script.Appendablejava.io.IOException - If an I/O error occurspublic static void main(java.lang.String[] args)
throws java.io.IOException
args - java.io.IOException