Class CryptoPolicy.Builder

java.lang.Object
cloud.opencode.base.crypto.policy.CryptoPolicy.Builder
Enclosing class:
CryptoPolicy

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

    • allow

      public CryptoPolicy.Builder allow(String... algorithms)
      Adds algorithms to the allowed set. 将算法添加到允许集合。
      Parameters:
      algorithms - algorithm names to allow | 要允许的算法名称
      Returns:
      this builder | 当前构建器
    • deny

      public CryptoPolicy.Builder deny(String... algorithms)
      Adds algorithms to the denied set. 将算法添加到拒绝集合。
      Parameters:
      algorithms - algorithm names to deny | 要拒绝的算法名称
      Returns:
      this builder | 当前构建器
    • minKeyBits

      public CryptoPolicy.Builder minKeyBits(String algorithm, int bits)
      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

      public CryptoPolicy build()
      Builds an immutable CryptoPolicy from the current builder state. 从当前构建器状态构建不可变的 CryptoPolicy。
      Returns:
      a new CryptoPolicy instance | 新的 CryptoPolicy 实例