Class PasswordAlgo

java.lang.Object
overit.geocall.util.password.PasswordAlgo
Direct Known Subclasses:
Argon2, Argon2V2, BCrypt, None, PBKDF2, PBKDF2V2, SCrypt, SCryptV2

public abstract class PasswordAlgo extends Object
Abstract class used to manage the algorithm to store a password
  • Field Details

  • Constructor Details

    • PasswordAlgo

      public PasswordAlgo()
  • Method Details

    • getInstance

      public static PasswordAlgo getInstance(PasswordAlgo.Type algo)
      Static method used to return an instance of a algorithm
      Parameters:
      algo - The type of algorithm
      Returns:
      An instance of the algorithm
    • check

      public abstract boolean check(String password, String stored)
      Checks if the stored hashed password corresponds
      Parameters:
      password - The password to check
      stored - The stored password to check
      Returns:
      true if the password corresponds to the stored one, false otherwise
    • generate

      public abstract String generate(String password)
      Generates the hashed password
      Parameters:
      password - To hash
      Returns:
      The hashed password
    • getType

      public abstract PasswordAlgo.Type getType()
      Returns the type of algorithm used
      Returns:
      The type of algorithm used