Class PKCS5S2SHA2PasswordHashGenerator

java.lang.Object
com.atlassian.crowd.password.encoder.PKCS5S2SHA2PasswordHashGenerator
All Implemented Interfaces:
com.atlassian.security.password.PasswordHashGenerator

public final class PKCS5S2SHA2PasswordHashGenerator extends Object implements com.atlassian.security.password.PasswordHashGenerator
This password hash generator mimics the PKCS5S2PasswordHashGenerator, but utilizes SHA-2 Encodes passwords using PKCS 5 version 2, as published by RSA and implemented in BouncyCastle. The iteration count is 10000 and the provided salt must be exactly 16 bytes. The generated hash will be 256 bits (32 bytes) long.

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

This generator is safe for use on multiple threads because it creates a new instance of the underlying generator for each call to generateHash(byte[], byte[]).

See Also:
  • Constructor Details

    • PKCS5S2SHA2PasswordHashGenerator

      public PKCS5S2SHA2PasswordHashGenerator()
  • Method Details

    • generateHash

      public byte[] generateHash(byte[] rawPassword, byte[] salt)
      Specified by:
      generateHash in interface com.atlassian.security.password.PasswordHashGenerator
    • getRequiredSaltLength

      public int getRequiredSaltLength()
      Specified by:
      getRequiredSaltLength in interface com.atlassian.security.password.PasswordHashGenerator