Class CryptoPolicy.Builder
java.lang.Object
cloud.opencode.base.crypto.policy.CryptoPolicy.Builder
- Enclosing class:
CryptoPolicy
Builder for constructing custom
CryptoPolicy instances.
用于构建自定义 CryptoPolicy 实例的构建器。- Since:
- JDK 25, opencode-base-crypto V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionAdds algorithms to the allowed set.build()Builds an immutable CryptoPolicy from the current builder state.Adds algorithms to the denied set.minKeyBits(String algorithm, int bits) Sets the minimum key size in bits for an algorithm.
-
Method Details
-
allow
Adds algorithms to the allowed set. 将算法添加到允许集合。- Parameters:
algorithms- algorithm names to allow | 要允许的算法名称- Returns:
- this builder | 当前构建器
-
deny
Adds algorithms to the denied set. 将算法添加到拒绝集合。- Parameters:
algorithms- algorithm names to deny | 要拒绝的算法名称- Returns:
- this builder | 当前构建器
-
minKeyBits
Sets the minimum key size in bits for an algorithm. 设置算法的最小密钥长度(比特)。- Parameters:
algorithm- the algorithm name | 算法名称bits- minimum key size in bits | 最小密钥长度(比特)- Returns:
- this builder | 当前构建器
-
build
Builds an immutable CryptoPolicy from the current builder state. 从当前构建器状态构建不可变的 CryptoPolicy。- Returns:
- a new CryptoPolicy instance | 新的 CryptoPolicy 实例
-