Package cn.gmkit.core

Class GmSecurityContexts

java.lang.Object
cn.gmkit.core.GmSecurityContexts

public final class GmSecurityContexts extends Object
常用安全上下文工厂。

提供默认上下文以及基于 Provider、随机源快速派生安全上下文的便捷方法。

  • Method Details

    • defaults

      public static GmSecurityContext defaults()
      获取默认安全上下文。
      Returns:
      默认安全上下文
    • withProvider

      public static GmSecurityContext withProvider(Provider provider)
      创建绑定指定 Provider 的安全上下文。
      Parameters:
      provider - Provider 实例
      Returns:
      安全上下文
    • withProviderAndRandom

      public static GmSecurityContext withProviderAndRandom(Provider provider, SecureRandom secureRandom)
      创建绑定指定 Provider 和随机源的安全上下文。
      Parameters:
      provider - Provider 实例
      secureRandom - SecureRandom 实例
      Returns:
      安全上下文
    • withSecureRandom

      public static GmSecurityContext withSecureRandom(SecureRandom secureRandom)
      创建绑定指定随机源的安全上下文。
      Parameters:
      secureRandom - SecureRandom 实例
      Returns:
      安全上下文