Enum Class CurveType

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

public enum CurveType extends Enum<CurveType>
Elliptic curve type enumeration - 椭圆曲线类型枚举 椭圆曲线类型的枚举定义

Features | 主要功能:

  • Elliptic curve type definitions - 椭圆曲线类型定义

Usage Examples | 使用示例:

CurveType curve = CurveType.P_256;

Security | 安全性:

  • Thread-safe: Yes - 线程安全: 是
  • Null-safe: Partial - 空值安全: 部分
Since:
JDK 25, opencode-base-crypto V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • P_256

      public static final CurveType P_256
      NIST P-256 curve (secp256r1, prime256v1)
    • P_384

      public static final CurveType P_384
      NIST P-384 curve (secp384r1)
    • P_521

      public static final CurveType P_521
      NIST P-521 curve (secp521r1)
    • SECP256K1

      public static final CurveType SECP256K1
      secp256k1 curve (used in Bitcoin and Ethereum)
    • CURVE25519

      public static final CurveType CURVE25519
      Curve25519 for ECDH (X25519)
    • CURVE448

      public static final CurveType CURVE448
      Curve448 for ECDH (X448)
    • ED25519

      public static final CurveType ED25519
      Ed25519 curve for EdDSA signatures
    • ED448

      public static final CurveType ED448
      Ed448 curve for EdDSA signatures
    • SM2

      public static final CurveType SM2
      SM2 curve (Chinese national standard, sm2p256v1)
  • Method Details

    • values

      public static CurveType[] 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 CurveType 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
    • getCurveName

      public String getCurveName()
      Gets the standard curve name 获取标准曲线名称
      Returns:
      the curve name
    • getKeySize

      public int getKeySize()
      Gets the key size in bits 获取密钥大小(位)
      Returns:
      the key size