Enum Class SignatureAlgorithm

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

public enum SignatureAlgorithm extends Enum<SignatureAlgorithm>
Digital signature algorithm enumeration - 数字签名算法枚举 数字签名算法的枚举定义

Features | 主要功能:

  • All supported signature algorithm definitions - 所有支持的签名算法定义

Usage Examples | 使用示例:

SignatureAlgorithm alg = SignatureAlgorithm.ED25519;

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

    • ED25519

      public static final SignatureAlgorithm ED25519
      Ed25519 signature algorithm (Recommended, EdDSA)
    • ED448

      public static final SignatureAlgorithm ED448
      Ed448 signature algorithm (Recommended, EdDSA)
    • ECDSA_P256_SHA256

      public static final SignatureAlgorithm ECDSA_P256_SHA256
      ECDSA with P-256 curve and SHA-256
    • ECDSA_P384_SHA384

      public static final SignatureAlgorithm ECDSA_P384_SHA384
      ECDSA with P-384 curve and SHA-384
    • ECDSA_P521_SHA512

      public static final SignatureAlgorithm ECDSA_P521_SHA512
      ECDSA with P-521 curve and SHA-512
    • RSA_SHA1

      public static final SignatureAlgorithm RSA_SHA1
      RSA signature with SHA-1 — legacy opt-in, deprecated. Only for interop with systems that still mandate SHA1withRSA.
    • RSA_SHA256

      public static final SignatureAlgorithm RSA_SHA256
      RSA signature with SHA-256
    • RSA_SHA384

      public static final SignatureAlgorithm RSA_SHA384
      RSA signature with SHA-384
    • RSA_SHA512

      public static final SignatureAlgorithm RSA_SHA512
      RSA signature with SHA-512
    • RSA_PSS_SHA256

      public static final SignatureAlgorithm RSA_PSS_SHA256
      RSA-PSS signature with SHA-256 (Recommended)
    • RSA_PSS_SHA384

      public static final SignatureAlgorithm RSA_PSS_SHA384
      RSA-PSS signature with SHA-384 (Recommended)
    • RSA_PSS_SHA512

      public static final SignatureAlgorithm RSA_PSS_SHA512
      RSA-PSS signature with SHA-512 (Recommended)
    • SM2

      public static final SignatureAlgorithm SM2
      SM2 signature with SM3 hash (Chinese national standard)
  • Method Details

    • values

      public static SignatureAlgorithm[] 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 SignatureAlgorithm 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
    • getAlgorithmName

      public String getAlgorithmName()
      Gets the signature algorithm name 获取签名算法名称
      Returns:
      the algorithm name
    • getKeyAlgorithm

      public String getKeyAlgorithm()
      Gets the key algorithm type 获取密钥算法类型
      Returns:
      the key algorithm (e.g., "RSA", "EC", "EdDSA")
    • isRecommended

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

      EdDSA and RSA-PSS variants are generally recommended for modern applications

      Returns:
      true if the algorithm is recommended, false otherwise