public boolean passwordIsAcceptable(ByteString newPassword,
Set<ByteString> currentPasswords,
Operation operation, Entry userEntry,
MessageBuilder invalidReason)
{
LengthBasedPasswordValidatorCfg config = currentConfig;
int numChars = newPassword.toString().length();
int minLength = config.getMinPasswordLength();
if ((minLength > 0) && (numChars < minLength))
{
invalidReason.append(ERR_PWLENGTHVALIDATOR_TOO_SHORT.get(minLength));
return false;
}
int maxLength = config.getMaxPasswordLength();
if ((maxLength > 0) && (numChars > maxLength))
{
invalidReason.append(ERR_PWLENGTHVALIDATOR_TOO_LONG.get(maxLength));
return false;
}