Enum Class AsymmetricAlgorithm

java.lang.Object
java.lang.Enum<AsymmetricAlgorithm>
cloud.opencode.base.crypto.enums.AsymmetricAlgorithm
All Implemented Interfaces:
Serializable, Comparable<AsymmetricAlgorithm>, Constable

public enum AsymmetricAlgorithm extends Enum<AsymmetricAlgorithm>
Asymmetric encryption algorithm enumeration - 非对称加密算法枚举 非对称加密算法的枚举定义

Features | 主要功能:

  • All supported asymmetric algorithm definitions - 所有支持的非对称算法定义

Usage Examples | 使用示例:

AsymmetricAlgorithm alg = AsymmetricAlgorithm.RSA_OAEP_SHA256;

Security | 安全性:

  • Thread-safe: Yes - 线程安全: 是
  • Null-safe: Partial - 空值安全: 部分

Performance | 性能特性:

  • Time complexity: O(1) - 时间复杂度: O(1)
  • Space complexity: O(1) - 空间复杂度: O(1)
Since:
JDK 25, opencode-base-crypto V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • RSA_OAEP_SHA256

      public static final AsymmetricAlgorithm RSA_OAEP_SHA256
      RSA with OAEP padding and SHA-256 (Recommended)
    • RSA_OAEP_SHA384

      public static final AsymmetricAlgorithm RSA_OAEP_SHA384
      RSA with OAEP padding and SHA-384 (Recommended)
    • RSA_OAEP_SHA512

      public static final AsymmetricAlgorithm RSA_OAEP_SHA512
      RSA with OAEP padding and SHA-512 (Recommended)
    • RSA_PKCS1

      public static final AsymmetricAlgorithm RSA_PKCS1
      RSA with PKCS1 padding (Legacy, not recommended for new applications)
    • SM2

      public static final AsymmetricAlgorithm SM2
      SM2 algorithm with 256-bit key (Chinese national standard)
  • Method Details

    • values

      public static AsymmetricAlgorithm[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AsymmetricAlgorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getTransformation

      public String getTransformation()
      Gets the cipher transformation string 获取密码转换字符串
      Returns:
      the transformation string
    • getMinKeySize

      public int getMinKeySize()
      Gets the minimum recommended key size in bits 获取最小推荐密钥大小(位)
      Returns:
      the minimum key size
    • isRecommended

      public boolean isRecommended()
      Checks if this algorithm is recommended for use 检查算法是否推荐使用

      OAEP padding variants are recommended over PKCS1 for better security

      Returns:
      true if the algorithm is recommended, false otherwise