Package org.passay
Class DigestDictionaryRule
- java.lang.Object
-
- org.passay.AbstractDictionaryRule
-
- org.passay.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 Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for matching dictionary word.static String
ERROR_CODE_REVERSED
Error code for matching reversed dictionary word.
-
Constructor Summary
Constructors Constructor Description DigestDictionaryRule(org.cryptacular.bean.HashBean<String> bean)
Creates new digest history rule which operates on password references that were digested with the supplied hash.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
doWordSearch(String text)
Searches the dictionary with the supplied text.protected String
getErrorCode(boolean backwards)
Returns the error code for this rule.void
setCharset(Charset set)
Sets the character set to use when converting a candidate password to bytes prior to hashing.-
Methods inherited from class org.passay.AbstractDictionaryRule
createRuleResultDetailParameters, getDictionary, isMatchBackwards, setDictionary, setMatchBackwards, toString, validate
-
-
-
-
Field Detail
-
ERROR_CODE
public static final String ERROR_CODE
Error code for matching dictionary word.- See Also:
- Constant Field Values
-
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 searchingbean
- 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
-
doWordSearch
protected String doWordSearch(String text)
Description copied from class:AbstractDictionaryRule
Searches the dictionary with the supplied text.- Specified by:
doWordSearch
in classAbstractDictionaryRule
- Parameters:
text
- to search dictionary with- Returns:
- matching word
-
getErrorCode
protected String getErrorCode(boolean backwards)
Description copied from class:AbstractDictionaryRule
Returns the error code for this rule.- Specified by:
getErrorCode
in classAbstractDictionaryRule
- Parameters:
backwards
- whether to return the error code for a backwards match- Returns:
- properties error code
-
-