Package org.passay

Class IllegalSequenceRule

  • All Implemented Interfaces:
    Rule

    public class IllegalSequenceRule
    extends Object
    implements Rule
    Password validation rule that prevents illegal sequences of characters, e.g. keyboard, alphabetical, numeric.
    Author:
    Middleware Services
    • Field Detail

      • DEFAULT_SEQUENCE_LENGTH

        public static final int DEFAULT_SEQUENCE_LENGTH
        Default length of keyboard sequence, value is 5.
        See Also:
        Constant Field Values
      • MINIMUM_SEQUENCE_LENGTH

        public static final int MINIMUM_SEQUENCE_LENGTH
        Minimum length of keyboard sequence, value is 3.
        See Also:
        Constant Field Values
      • sequenceData

        protected final SequenceData sequenceData
        Sequence data for this rule.
      • sequenceLength

        protected int sequenceLength
        Number of characters in sequence to match.
      • wrapSequence

        protected boolean wrapSequence
        Whether or not to wrap a sequence when searching for matches.
      • reportAllFailures

        protected boolean reportAllFailures
        Whether to report all sequence matches or just the first.
    • Constructor Detail

      • IllegalSequenceRule

        public IllegalSequenceRule​(SequenceData data)
        Creates a new sequence rule with the supplied list of characters.
        Parameters:
        data - sequence data for this rule
      • IllegalSequenceRule

        public IllegalSequenceRule​(SequenceData data,
                                   int sl,
                                   boolean wrap)
        Creates a new sequence rule with the supplied list of characters.
        Parameters:
        data - sequence data for this rule
        sl - sequence length
        wrap - whether to wrap sequences
      • IllegalSequenceRule

        public IllegalSequenceRule​(SequenceData data,
                                   int sl,
                                   boolean wrap,
                                   boolean reportAll)
        Creates a new sequence rule with the supplied list of characters.
        Parameters:
        data - sequence data for this rule
        sl - sequence length
        wrap - whether to wrap sequences
        reportAll - whether to report all sequence matches or just the first
    • Method Detail

      • getSequenceLength

        public int getSequenceLength()
        Returns the sequence length for this rule.
        Returns:
        sequence length
      • getSequenceData

        public SequenceData getSequenceData()
        Returns the sequence data for this rule.
        Returns:
        sequence data
      • validate

        public RuleResult validate​(PasswordData passwordData)
        Description copied from interface: Rule
        Validates the supplied password data per the requirements of this rule.
        Specified by:
        validate in interface Rule
        Parameters:
        passwordData - to verify (not null).
        Returns:
        details on password verification