Enum Class AsymmetricAlgorithm
- All Implemented Interfaces:
Serializable, Comparable<AsymmetricAlgorithm>, Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRSA with OAEP padding and SHA-256 (Recommended)RSA with OAEP padding and SHA-384 (Recommended)RSA with OAEP padding and SHA-512 (Recommended)RSA with PKCS1 padding (Legacy, not recommended for new applications)SM2 algorithm with 256-bit key (Chinese national standard) -
Method Summary
Modifier and TypeMethodDescriptionintGets the minimum recommended key size in bits 获取最小推荐密钥大小(位)Gets the cipher transformation string 获取密码转换字符串booleanChecks if this algorithm is recommended for use 检查算法是否推荐使用static AsymmetricAlgorithmReturns the enum constant of this class with the specified name.static AsymmetricAlgorithm[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RSA_OAEP_SHA256
RSA with OAEP padding and SHA-256 (Recommended) -
RSA_OAEP_SHA384
RSA with OAEP padding and SHA-384 (Recommended) -
RSA_OAEP_SHA512
RSA with OAEP padding and SHA-512 (Recommended) -
RSA_PKCS1
RSA with PKCS1 padding (Legacy, not recommended for new applications) -
SM2
SM2 algorithm with 256-bit key (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
-
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
-