Class DigestHistoryRule

java.lang.Object
org.passay.rule.HistoryRule
org.passay.rule.DigestHistoryRule
All Implemented Interfaces:
Rule

public class DigestHistoryRule extends HistoryRule
Rule for determining if a password matches one of any previous digested password a user has chosen. If no password reference has been set that matches the label on the rule, then passwords will meet this rule. See PasswordData.getPasswordReferences().
  • Field Details

    • hashBean

      private final org.cryptacular.bean.HashBean<CharSequence> hashBean
      Hash bean to use for comparing hashed passwords.
    • charset

      private final Charset charset
      Character set to use for undigested passwords.
  • Constructor Details

    • DigestHistoryRule

      public DigestHistoryRule(org.cryptacular.bean.HashBean<CharSequence> bean)
      Creates new digest history rule which operates on password references that were digested with the supplied hash.
      Parameters:
      bean - encoding hash bean
    • DigestHistoryRule

      public DigestHistoryRule(org.cryptacular.bean.HashBean<CharSequence> bean, Charset set)
      Creates new digest history rule which operates on password references that were digested with the supplied hash.
      Parameters:
      bean - encoding hash bean
      set - to use for undigested passwords
  • Method Details

    • matches

      protected boolean matches(UnicodeString password, Reference reference)
      Determines whether a digested password matches a reference value.
      Overrides:
      matches in class HistoryRule
      Parameters:
      password - candidate clear text password.
      reference - reference digested password.
      Returns:
      true if passwords match, false otherwise.