Class PasswordManager

java.lang.Object
main.controller.account.password.PasswordManager

public class PasswordManager extends Object
A class manages the password of a user
  • Constructor Details

    • PasswordManager

      public PasswordManager()
  • Method Details

    • checkPassword

      public static boolean checkPassword(User user, String password)
      Checks if the password is correct
      Parameters:
      user - the user whose password is to be checked
      password - the password to be checked
      Returns:
      true if the password is correct, false otherwise
    • changePassword

      public static void changePassword(User user, String oldPassword, String newPassword) throws PasswordIncorrectException
      Changes the password of the user
      Parameters:
      user - the user whose password is to be changed
      oldPassword - the old password
      newPassword - the new password
      Throws:
      PasswordIncorrectException - if the old password is incorrect