Package org.passay

Class DigestDictionaryRule

  • All Implemented Interfaces:
    Rule

    public class DigestDictionaryRule
    extends AbstractDictionaryRule
    Rule for determining if a password matches a digested password that is stored in a dictionary.
    Author:
    Middleware Services
    • Field Detail

      • ERROR_CODE_REVERSED

        public static final String ERROR_CODE_REVERSED
        Error code for matching reversed dictionary word.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DigestDictionaryRule

        public DigestDictionaryRule​(org.cryptacular.bean.HashBean<String> bean,
                                    Dictionary dict)
        Creates new digest history rule which operates on password references that were digested with the supplied hash. The dictionary should be ready to use when passed to this constructor.
        Parameters:
        dict - to use for searching
        bean - encoding hash bean
      • DigestDictionaryRule

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

      • setCharset

        public void setCharset​(Charset set)
        Sets the character set to use when converting a candidate password to bytes prior to hashing.
        Parameters:
        set - to use for undigested passwords
      • getErrorCode

        protected String getErrorCode​(boolean backwards)
        Description copied from class: AbstractDictionaryRule
        Returns the error code for this rule.
        Specified by:
        getErrorCode in class AbstractDictionaryRule
        Parameters:
        backwards - whether to return the error code for a backwards match
        Returns:
        properties error code