Enum Class EcdhCurveSpec
- All Implemented Interfaces:
Serializable, Comparable<EcdhCurveSpec>, Constable, AlgorithmKeySpec, ContextSpec
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
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns the JCA-standardized name of the elliptic curve.Returns the JCA factory name of the corresponding signature algorithm (ECDSA with hash, P1363 encoding).intReturns the fixed byte length of deterministic ECDSA signatures for this curve in P1363 format.static EcdhCurveSpecReturns the enum constant of this class with the specified name.static EcdhCurveSpec[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
P256
NIST P-256 (secp256r1), approx. 128-bit security. -
P384
NIST P-384 (secp384r1), approx. 192-bit security. -
P512
NIST P-521 (secp521r1), approx. 256-bit security.
-
-
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
-
curveName
Returns the JCA-standardized name of the elliptic curve.- Returns:
- curve name, e.g.,
"secp256r1"
-
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
-