Class PBKDF2PasswordHasher

java.lang.Object
org.yamcs.security.PBKDF2PasswordHasher
All Implemented Interfaces:
PasswordHasher

public class PBKDF2PasswordHasher extends Object implements PasswordHasher
  • Field Details

  • Constructor Details

    • PBKDF2PasswordHasher

      public PBKDF2PasswordHasher()
  • Method Details

    • createHash

      public String createHash(char[] password)
      Returns a salted PBKDF2 hash of the password.
      Specified by:
      createHash in interface PasswordHasher
      Parameters:
      password - the password to hash
      Returns:
      a salted PBKDF2 hash of the password
    • validatePassword

      public boolean validatePassword(char[] password, String correctHash)
      Validates a password using a hash.
      Specified by:
      validatePassword in interface PasswordHasher
      Parameters:
      password - the password to check
      correctHash - the hash of the valid password
      Returns:
      true if the password is correct, false if not