Class Pbkdf2Hash.Builder
java.lang.Object
cloud.opencode.base.crypto.password.Pbkdf2Hash.Builder
- Enclosing class:
Pbkdf2Hash
Builder for creating custom Pbkdf2Hash instances
用于创建自定义 Pbkdf2Hash 实例的构建器
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionalgorithm(DigestAlgorithm algorithm) Set the digest algorithm 设置摘要算法build()Build the Pbkdf2Hash instance 构建 Pbkdf2Hash 实例iterations(int iterations) Set the number of iterations 设置迭代次数keyLength(int length) Set the key output length in bits 设置密钥输出长度(位)saltLength(int length) Set the salt length in bytes 设置盐长度(字节)secureRandom(SecureRandom secureRandom) Set custom SecureRandom instance 设置自定义 SecureRandom 实例
-
Method Details
-
algorithm
Set the digest algorithm 设置摘要算法- Parameters:
algorithm- the digest algorithm (SHA256, SHA384, or SHA512 recommended)- Returns:
- this builder
-
iterations
Set the number of iterations 设置迭代次数- Parameters:
iterations- iteration count (minimum 10000, recommended 600000 for SHA256)- Returns:
- this builder
-
keyLength
Set the key output length in bits 设置密钥输出长度(位)- Parameters:
length- key length in bits (minimum 128, recommended 256)- Returns:
- this builder
-
saltLength
Set the salt length in bytes 设置盐长度(字节)- Parameters:
length- salt length in bytes (minimum 8, recommended 16)- Returns:
- this builder
-
secureRandom
Set custom SecureRandom instance 设置自定义 SecureRandom 实例- Parameters:
secureRandom- the SecureRandom instance- Returns:
- this builder
-
build
Build the Pbkdf2Hash instance 构建 Pbkdf2Hash 实例- Returns:
- new Pbkdf2Hash instance
-