Interface PasswordHashGenerator

All Known Implementing Classes:
PKCS5S2PasswordHashGenerator

public interface PasswordHashGenerator
Used by DefaultPasswordEncoder to generate encoded password bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    generateHash(byte[] password, byte[] salt)
    Encodes the rawPassword bytes and salt according to their method specified by the implementation.
    int
    Returns the required salt length for this hash generator, zero if this generator does not require a salt or -1 if the generator accepts salts of varying length.
  • Method Details

    • generateHash

      byte[] generateHash(byte[] password, byte[] salt)
      Encodes the rawPassword bytes and salt according to their method specified by the implementation. The encoded bytes should be returned without including the salt.
      Parameters:
      password - the password to be encoded
      salt - a salt which may be used by some algorithms
      Returns:
      the encoded password bytes (without appending or prepending the salt)
    • getRequiredSaltLength

      int getRequiredSaltLength()
      Returns the required salt length for this hash generator, zero if this generator does not require a salt or -1 if the generator accepts salts of varying length.