Class Argon2PasswordEncoderConfigurationProperties

java.lang.Object
io.micronaut.security.password.argon2.Argon2PasswordEncoderConfigurationProperties
All Implemented Interfaces:
Argon2PasswordEncoderConfiguration

@ConfigurationProperties("micronaut.security.password.argon2") @Context @ValidArgon2Costs @Internal public final class Argon2PasswordEncoderConfigurationProperties extends Object implements Argon2PasswordEncoderConfiguration
Binds configuration for the Argon2id password encoder.

The configuration is bound and validated when the application context starts, so an invalid configuration prevents the application from starting.

Since:
5.5.0
  • Field Details

    • PREFIX

      public static final String PREFIX
      Configuration prefix for the Argon2id password encoder.
      See Also:
    • DEFAULT_MEMORY

      public static final int DEFAULT_MEMORY
      Default memory cost, in kibibytes.
      See Also:
    • DEFAULT_ITERATIONS

      public static final int DEFAULT_ITERATIONS
      Default number of iterations.
      See Also:
    • DEFAULT_PARALLELISM

      public static final int DEFAULT_PARALLELISM
      Default degree of parallelism.
      See Also:
    • DEFAULT_SALT_LENGTH

      public static final int DEFAULT_SALT_LENGTH
      Default salt length, in bytes.
      See Also:
    • DEFAULT_HASH_LENGTH

      public static final int DEFAULT_HASH_LENGTH
      Default hash length, in bytes.
      See Also:
    • DEFAULT_MAX_MEMORY

      public static final int DEFAULT_MAX_MEMORY
      Default highest memory cost, in kibibytes, accepted when verifying an encoded password.
      See Also:
    • DEFAULT_MAX_ITERATIONS

      public static final int DEFAULT_MAX_ITERATIONS
      Default highest number of iterations accepted when verifying an encoded password.
      See Also:
  • Constructor Details

    • Argon2PasswordEncoderConfigurationProperties

      public Argon2PasswordEncoderConfigurationProperties()
  • Method Details

    • getMemory

      public int getMemory()
      Specified by:
      getMemory in interface Argon2PasswordEncoderConfiguration
      Returns:
      the memory cost, in kibibytes, used to encode passwords
    • setMemory

      public void setMemory(int memory)
      Sets the memory cost, in kibibytes, used to encode passwords. It must be at least eight times the parallelism and at most the maximum memory. Default value (19456).
      Parameters:
      memory - the memory cost, in kibibytes
    • getIterations

      public int getIterations()
      Specified by:
      getIterations in interface Argon2PasswordEncoderConfiguration
      Returns:
      the number of iterations used to encode passwords
    • setIterations

      public void setIterations(int iterations)
      Sets the number of iterations used to encode passwords. It must be at least 1 and at most the maximum iterations. Default value (2).
      Parameters:
      iterations - the number of iterations
    • getParallelism

      public int getParallelism()
      Specified by:
      getParallelism in interface Argon2PasswordEncoderConfiguration
      Returns:
      the degree of parallelism used to encode passwords
    • setParallelism

      public void setParallelism(int parallelism)
      Sets the degree of parallelism used to encode passwords. It must be between 1 and 255. Default value (1).
      Parameters:
      parallelism - the degree of parallelism
    • getSaltLength

      public int getSaltLength()
      Specified by:
      getSaltLength in interface Argon2PasswordEncoderConfiguration
      Returns:
      the length of the generated salt, in bytes
    • setSaltLength

      public void setSaltLength(int saltLength)
      Sets the length, in bytes, of the salt generated for each encoded password. It must be between 8 and 48. Default value (16).
      Parameters:
      saltLength - the salt length, in bytes
    • getHashLength

      public int getHashLength()
      Specified by:
      getHashLength in interface Argon2PasswordEncoderConfiguration
      Returns:
      the length of the generated hash, in bytes
    • setHashLength

      public void setHashLength(int hashLength)
      Sets the length, in bytes, of the hash generated for each encoded password. It must be between 12 and 64. Default value (32).
      Parameters:
      hashLength - the hash length, in bytes
    • getMaxMemory

      public int getMaxMemory()
      Specified by:
      getMaxMemory in interface Argon2PasswordEncoderConfiguration
      Returns:
      the highest memory cost, in kibibytes, accepted when verifying an encoded password
    • setMaxMemory

      public void setMaxMemory(int maxMemory)
      Sets the highest memory cost, in kibibytes, accepted when verifying an encoded password. An encoded password that declares a higher memory cost does not match any password. Default value (262144).
      Parameters:
      maxMemory - the highest memory cost, in kibibytes
    • getMaxIterations

      public int getMaxIterations()
      Specified by:
      getMaxIterations in interface Argon2PasswordEncoderConfiguration
      Returns:
      the highest number of iterations accepted when verifying an encoded password
    • setMaxIterations

      public void setMaxIterations(int maxIterations)
      Sets the highest number of iterations accepted when verifying an encoded password. An encoded password that declares more iterations does not match any password. Default value (10).
      Parameters:
      maxIterations - the highest number of iterations