Class MessageDigestPassword.Encoder

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

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

A MessageDigest based password encoder implementation.

Since:
1.5
Author:
Jeremy Kuhn
  • Field Details

    • DEFAULT_ALGORITHM

      public static final String DEFAULT_ALGORITHM
      The default algorithm: SHA-512.
      See Also:
    • DEFAULT_SECRET

      public static final byte[] DEFAULT_SECRET
      The default secret: new byte[0].
    • DEFAULT_SALT_LENGTH

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

    • Encoder

      public Encoder()

      Creates a default message digest password encoder.

    • Encoder

      public Encoder(String algorithm)

      Creates a message digest password encoder using the specified algorithm.

      Parameters:
      algorithm - the algorithm
    • Encoder

      public Encoder(String algorithm, byte[] secret)

      Creates a message digest password encoder using the specified algorithm and secret.

      Parameters:
      algorithm - the algorithm
      secret - the secret
    • Encoder

      public Encoder(String algorithm, byte[] secret, int saltLength)

      Creates a message digest password encoder using the specified algorithm, secret and salt length.

      Parameters:
      algorithm - the algorithm
      secret - the secret
      saltLength - the salt length in kikibytes
    • Encoder

      public Encoder(String algorithm, byte[] secret, int saltLength, SecureRandom secureRandom)

      Creates a message digest password encoder using the specified algorithm, secret, salt length and secure random.

      Parameters:
      algorithm - the algorithm
      secret - the secret
      saltLength - the salt length in kikibytes
      secureRandom - the secure random
  • Method Details