Class DigestSourceRule

java.lang.Object
org.passay.rule.SourceRule
org.passay.rule.DigestSourceRule
All Implemented Interfaces:
Rule

public class DigestSourceRule extends SourceRule
Rule for determining if a password matches a digested password from a different source. Useful for when separate systems cannot have matching passwords. 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

    • DigestSourceRule

      public DigestSourceRule(org.cryptacular.bean.HashBean<CharSequence> bean)
      Creates new digest source rule which operates on password references with the supplied label.
      Parameters:
      bean - encoding hash bean
    • DigestSourceRule

      public DigestSourceRule(org.cryptacular.bean.HashBean<CharSequence> bean, Charset set)
      Creates new digest source rule which operates on password references with the supplied label.
      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 SourceRule
      Parameters:
      password - candidate clear text password.
      reference - reference digested password.
      Returns:
      true if passwords match, false otherwise.