Class BCryptPassword.Encoder

java.lang.Object
io.inverno.mod.security.authentication.password.BCryptPassword.Encoder
All Implemented Interfaces:
Password.Encoder<BCryptPassword,BCryptPassword.Encoder>
Enclosing class:
BCryptPassword

public static class BCryptPassword.Encoder extends Object implements Password.Encoder<BCryptPassword,BCryptPassword.Encoder>

A Bcrypt password encoder implementation.

Since:
1.5
Author:
Jeremy Kuhn
  • Field Details

    • DEFAULT_COST

      public static final int DEFAULT_COST
      The default cost: 10.
      See Also:
    • SALT_LENGTH

      public static final int SALT_LENGTH
      The default salt length in kikibytes: 16.
      See Also:
  • Constructor Details

    • Encoder

      public Encoder()

      Creates a default Bcrypt password encoder.

    • Encoder

      public Encoder(int cost, int saltLength) throws IllegalArgumentException

      Creates a Bcrypt password encoder with the specified cost and salt length.

      Parameters:
      cost - the cost
      saltLength - the salt length in kikibytes
      Throws:
      IllegalArgumentException - if specified parameters are incorrect
    • Encoder

      public Encoder(int cost, int saltLength, SecureRandom secureRandom) throws IllegalArgumentException

      Creates a Bcrypt password encoder with the specified cost, salt length and secure random.

      Parameters:
      cost - the cost
      saltLength - the salt length in kikibytes
      secureRandom - the secure random
      Throws:
      IllegalArgumentException - if specified parameters are incorrect
  • Method Details