Class Argon2Kdf.Builder
java.lang.Object
cloud.opencode.base.crypto.kdf.Argon2Kdf.Builder
- Enclosing class:
Argon2Kdf
Builder for Argon2Kdf configuration
Argon2Kdf 配置构建器
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the Argon2Kdf instance 构建 Argon2Kdf 实例iterations(int iterations) Sets the number of iterations 设置迭代次数memory(int memoryKB) Sets the memory size in kilobytes 设置内存大小(千字节)parallelism(int parallelism) Sets the parallelism factor 设置并行度因子type(Argon2Type type) Sets the Argon2 type 设置 Argon2 类型
-
Method Details
-
memory
Sets the memory size in kilobytes 设置内存大小(千字节)- Parameters:
memoryKB- memory in KB (must be at least 8 * parallelism)- Returns:
- this builder
-
iterations
Sets the number of iterations 设置迭代次数- Parameters:
iterations- number of iterations (must be positive)- Returns:
- this builder
-
parallelism
Sets the parallelism factor 设置并行度因子- Parameters:
parallelism- degree of parallelism (must be positive)- Returns:
- this builder
-
type
Sets the Argon2 type 设置 Argon2 类型- Parameters:
type- the Argon2 variant to use- Returns:
- this builder
-
build
Builds the Argon2Kdf instance 构建 Argon2Kdf 实例- Returns:
- new Argon2Kdf instance
- Throws:
IllegalArgumentException- if parameters are invalid
-