Enum Class EcdhCurveSpec

java.lang.Object
java.lang.Enum<EcdhCurveSpec>
zeroecho.core.alg.ecdh.EcdhCurveSpec
All Implemented Interfaces:
Serializable, Comparable<EcdhCurveSpec>, Constable, AlgorithmKeySpec, ContextSpec

public enum EcdhCurveSpec extends Enum<EcdhCurveSpec> implements ContextSpec, AlgorithmKeySpec

Standardized ECDH Curve Specifications

Enumeration of commonly used NIST-recommended elliptic curves for ECDH (Elliptic Curve Diffie-Hellman) and related algorithms.

Each constant provides:

  • Curve name - the JCA-standardized name, suitable for use with ECGenParameterSpec.
  • Signature algorithm name - a JCA/JCE identifier combining the hash function and ECDSA variant in P1363 encoding.
  • Fixed signature length - the expected byte length of deterministic ECDSA signatures for the curve, following the P1363 format.

Curves

  • P256 - secp256r1, 128-bit security level.
  • P384 - secp384r1, 192-bit security level.
  • P512 - secp521r1, ~256-bit security level.

Usage

// Generate a key pair on P-256
KeyPair kp = session.keyBuilders().asymmetric().generateKeyPair("ECDH", EcdhCurveSpec.P256);

// Use curve metadata
String jcaName = EcdhCurveSpec.P256.curveName(); // "secp256r1"
int sigLen = EcdhCurveSpec.P256.signFixedLength(); // 64 bytes
Since:
1.0
  • Enum Constant Details

    • P256

      public static final EcdhCurveSpec P256
      NIST P-256 (secp256r1), approx. 128-bit security.
    • P384

      public static final EcdhCurveSpec P384
      NIST P-384 (secp384r1), approx. 192-bit security.
    • P512

      public static final EcdhCurveSpec P512
      NIST P-521 (secp521r1), approx. 256-bit security.
  • Method Details

    • values

      public static EcdhCurveSpec[] 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 EcdhCurveSpec 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
    • curveName

      public String curveName()
      Returns the JCA-standardized name of the elliptic curve.
      Returns:
      curve name, e.g., "secp256r1"
    • jcaFactory

      public String jcaFactory()
      Returns the JCA factory name of the corresponding signature algorithm (ECDSA with hash, P1363 encoding).
      Returns:
      JCA algorithm name, e.g., "SHA256withECDSAinP1363Format"
    • signFixedLength

      public int signFixedLength()
      Returns the fixed byte length of deterministic ECDSA signatures for this curve in P1363 format.
      Returns:
      fixed signature length in bytes