Class RandomSaltGenerator

java.lang.Object
com.atlassian.security.password.RandomSaltGenerator
All Implemented Interfaces:
SaltGenerator

public final class RandomSaltGenerator extends Object implements SaltGenerator
Generates a salt using a static instance of Random. Because Random is thread-safe, salt generation using this class is also thread-safe.

Clients should not use this class directly, but pass an instance to DefaultPasswordEncoder.

  • Constructor Details

    • RandomSaltGenerator

      public RandomSaltGenerator()
  • Method Details

    • generateSalt

      public byte[] generateSalt(int length)
      Description copied from interface: SaltGenerator
      Returns a byte array of the required length containing a random salt value.
      Specified by:
      generateSalt in interface SaltGenerator