Class Pbkdf2Hash.Builder

java.lang.Object
cloud.opencode.base.crypto.password.Pbkdf2Hash.Builder
Enclosing class:
Pbkdf2Hash

public static class Pbkdf2Hash.Builder extends Object
Builder for creating custom Pbkdf2Hash instances 用于创建自定义 Pbkdf2Hash 实例的构建器
Since:
JDK 25, opencode-base-crypto V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • algorithm

      public Pbkdf2Hash.Builder algorithm(DigestAlgorithm algorithm)
      Set the digest algorithm 设置摘要算法
      Parameters:
      algorithm - the digest algorithm (SHA256, SHA384, or SHA512 recommended)
      Returns:
      this builder
    • iterations

      public Pbkdf2Hash.Builder iterations(int iterations)
      Set the number of iterations 设置迭代次数
      Parameters:
      iterations - iteration count (minimum 10000, recommended 600000 for SHA256)
      Returns:
      this builder
    • keyLength

      public Pbkdf2Hash.Builder keyLength(int length)
      Set the key output length in bits 设置密钥输出长度(位)
      Parameters:
      length - key length in bits (minimum 128, recommended 256)
      Returns:
      this builder
    • saltLength

      public Pbkdf2Hash.Builder saltLength(int length)
      Set the salt length in bytes 设置盐长度(字节)
      Parameters:
      length - salt length in bytes (minimum 8, recommended 16)
      Returns:
      this builder
    • secureRandom

      public Pbkdf2Hash.Builder secureRandom(SecureRandom secureRandom)
      Set custom SecureRandom instance 设置自定义 SecureRandom 实例
      Parameters:
      secureRandom - the SecureRandom instance
      Returns:
      this builder
    • build

      public Pbkdf2Hash build()
      Build the Pbkdf2Hash instance 构建 Pbkdf2Hash 实例
      Returns:
      new Pbkdf2Hash instance