Construct a password using the given String as the "user's pick".
throws
java.lang.IllegalArgumentException If password too short.
if (p.length() < MIN_LENGTH)
throw new IllegalArgumentException(
"Password " + p + " length less than minimum of " + MIN_LENGTH);
pw = p;
public Password()
Construct a password: we pick the password.
This constructor is wasteful: you are better off using the
static method getNext(), which returns a new Password object.
/* Generate a Password object with a random password. */
StringBuffer sb = new StringBuffer();
for (int i=0; i < MIN_LENGTH + 2; i++) {
sb.append(goodChar[r.nextInt(goodChar.length)]);
}
return new Password(sb.toString());