Enum Class SignatureAlgorithm
- All Implemented Interfaces:
Serializable, Comparable<SignatureAlgorithm>, Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionECDSA with P-256 curve and SHA-256ECDSA with P-384 curve and SHA-384ECDSA with P-521 curve and SHA-512Ed25519 signature algorithm (Recommended, EdDSA)Ed448 signature algorithm (Recommended, EdDSA)RSA-PSS signature with SHA-256 (Recommended)RSA-PSS signature with SHA-384 (Recommended)RSA-PSS signature with SHA-512 (Recommended)RSA signature with SHA-1 — legacy opt-in, deprecated.RSA signature with SHA-256RSA signature with SHA-384RSA signature with SHA-512SM2 signature with SM3 hash (Chinese national standard) -
Method Summary
Modifier and TypeMethodDescriptionGets the signature algorithm name 获取签名算法名称Gets the key algorithm type 获取密钥算法类型booleanChecks if this algorithm is recommended for use 检查算法是否推荐使用static SignatureAlgorithmReturns the enum constant of this class with the specified name.static SignatureAlgorithm[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ED25519
Ed25519 signature algorithm (Recommended, EdDSA) -
ED448
Ed448 signature algorithm (Recommended, EdDSA) -
ECDSA_P256_SHA256
ECDSA with P-256 curve and SHA-256 -
ECDSA_P384_SHA384
ECDSA with P-384 curve and SHA-384 -
ECDSA_P521_SHA512
ECDSA with P-521 curve and SHA-512 -
RSA_SHA1
RSA signature with SHA-1 — legacy opt-in, deprecated. Only for interop with systems that still mandate SHA1withRSA. -
RSA_SHA256
RSA signature with SHA-256 -
RSA_SHA384
RSA signature with SHA-384 -
RSA_SHA512
RSA signature with SHA-512 -
RSA_PSS_SHA256
RSA-PSS signature with SHA-256 (Recommended) -
RSA_PSS_SHA384
RSA-PSS signature with SHA-384 (Recommended) -
RSA_PSS_SHA512
RSA-PSS signature with SHA-512 (Recommended) -
SM2
SM2 signature with SM3 hash (Chinese national standard)
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getAlgorithmName
Gets the signature algorithm name 获取签名算法名称- Returns:
- the algorithm name
-
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
-