Class ShannonEntropyFactory

java.lang.Object
org.passay.entropy.ShannonEntropyFactory

public final class ShannonEntropyFactory extends Object
Factory for creating ShannonEntropy from password rules and password data.
  • Field Details

    • COMPOSITION_CHARACTERISTICS_REQUIREMENT

      private static final int COMPOSITION_CHARACTERISTICS_REQUIREMENT
      Number of character characteristics rules to enforce for a password to have composition.
      See Also:
    • COMPOSITION_VALIDATOR

      private static final PasswordValidator COMPOSITION_VALIDATOR
      Validator which decides whether a password has composition.
  • Constructor Details

    • ShannonEntropyFactory

      private ShannonEntropyFactory()
      Private constructor for factory class.
  • Method Details

    • createEntropy

      public static ShannonEntropy createEntropy(List<? extends Rule> passwordRules, PasswordData passwordData)
      Creates a new shannon entropy.
      Parameters:
      passwordRules - to aid in entropy calculation
      passwordData - to aid in entropy calculation
      Returns:
      shannon entropy
    • createEntropy

      public static ShannonEntropy createEntropy(boolean dictionaryCheck, PasswordData passwordData)
      Creates a new shannon entropy.
      Parameters:
      dictionaryCheck - whether a common passwords dictionary is checked against the password
      passwordData - to aid in entropy calculation
      Returns:
      shannon entropy
    • hasComposition

      private static boolean hasComposition(PasswordData passwordData)
      Checks whether the supplied passwordData has composition. (As suggested by NIST SP-800-63-1)
      Parameters:
      passwordData - to check for composition
      Returns:
      true if valid, false otherwise