Package org.passay.rule
Class DigestDictionaryRule
java.lang.Object
org.passay.rule.AbstractDictionaryRule
org.passay.rule.DigestDictionaryRule
- All Implemented Interfaces:
Rule
Rule for determining if a password matches a digested password that is stored in a dictionary.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CharsetCharacter set to use for undigested passwords.static final StringError code for matching dictionary word.static final StringError code for matching reversed dictionary word.private final org.cryptacular.bean.HashBean<CharSequence>Hash bean to use for comparing hashed passwords. -
Constructor Summary
ConstructorsConstructorDescriptionDigestDictionaryRule(org.cryptacular.bean.HashBean<CharSequence> bean, Dictionary dict) Creates new digest history rule which operates on password references that were digested with the supplied hash.DigestDictionaryRule(org.cryptacular.bean.HashBean<CharSequence> bean, Dictionary dict, boolean matchBackwards) Creates new digest history rule which operates on password references that were digested with the supplied hash.DigestDictionaryRule(org.cryptacular.bean.HashBean<CharSequence> bean, Dictionary dict, boolean matchBackwards, Charset set) Creates new digest history rule which operates on password references that were digested with the supplied hash. -
Method Summary
Modifier and TypeMethodDescriptionprotected CharSequencedoWordSearch(UnicodeString text) Searches the dictionary with the supplied text.protected StringgetErrorCode(boolean backwards) Returns the error code for this rule.Methods inherited from class org.passay.rule.AbstractDictionaryRule
createRuleResultDetailParameters, getDictionary, isMatchBackwards, toString, validate
-
Field Details
-
ERROR_CODE
Error code for matching dictionary word.- See Also:
-
ERROR_CODE_REVERSED
Error code for matching reversed dictionary word.- See Also:
-
hashBean
Hash bean to use for comparing hashed passwords. -
charset
Character set to use for undigested passwords.
-
-
Constructor Details
-
DigestDictionaryRule
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<CharSequence> bean, Dictionary dict, boolean matchBackwards) 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 beanmatchBackwards- whether to match dictionary words backwards
-
DigestDictionaryRule
public DigestDictionaryRule(org.cryptacular.bean.HashBean<CharSequence> bean, Dictionary dict, boolean matchBackwards, Charset set) 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 beanmatchBackwards- whether to match dictionary words backwardsset- to use for undigested passwords
-
-
Method Details
-
doWordSearch
Description copied from class:AbstractDictionaryRuleSearches the dictionary with the supplied text.- Specified by:
doWordSearchin classAbstractDictionaryRule- Parameters:
text- to search dictionary with- Returns:
- matching word
-
getErrorCode
Description copied from class:AbstractDictionaryRuleReturns the error code for this rule.- Specified by:
getErrorCodein classAbstractDictionaryRule- Parameters:
backwards- whether to return the error code for a backwards match- Returns:
- properties error code
-