Enum Class EcdsaCurveSpec
- All Implemented Interfaces:
Serializable, Comparable<EcdsaCurveSpec>, Constable, Describable, AlgorithmKeySpec, ContextSpec
public enum EcdsaCurveSpec
extends Enum<EcdsaCurveSpec>
implements ContextSpec, AlgorithmKeySpec, Describable
ECDSA Curve Specifications
Enumeration of supported elliptic curve domain parameters for theEcdsaAlgorithm. Each value binds a named curve, its associated JCA
signature algorithm string, and the fixed-length of produced signatures in
bytes (P1363 format).
Curves
P256- NIST P-256 (secp256r1), 64-byte signatures, SHA-256 digest binding.P384- NIST P-384 (secp384r1), 96-byte signatures, SHA-384 digest binding.P512- NIST P-521 (secp521r1), 132-byte signatures, SHA-512 digest binding.
Usage
The specification is used both as aContextSpec for
signature contexts and as an AlgorithmKeySpec for key pair generation
or import. It ensures consistent algorithm selection and enforces
deterministic signature lengths.
// Example: select curve specification
EcdsaCurveSpec spec = EcdsaCurveSpec.P256;
String curve = spec.curveName(); // "secp256r1"
String jcaAlg = spec.jcaFactory(); // "SHA256withECDSAinP1363Format"
int sigLen = spec.signFixedLength(); // 64
- 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 canonical JCA curve name.Returns a short, human-readable description of this object.static Optional<EcdsaCurveSpec> fromSignatureAlgorithmId(String algorithmId) Resolves a standard external ECDSA signature algorithm identifier to the corresponding curve specification used by ZeroEcho.Returns the JCA algorithm identifier for this curve.intReturns the fixed signature length for this curve in bytes.static EcdsaCurveSpecReturns the enum constant of this class with the specified name.static EcdsaCurveSpec[]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), SHA-256 binding, 64-byte signatures. -
P384
NIST P-384 (secp384r1), SHA-384 binding, 96-byte signatures. -
P512
NIST P-521 (secp521r1), SHA-512 binding, 132-byte signatures.
-
-
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 canonical JCA curve name.- Returns:
- curve name string (e.g.,
"secp256r1")
-
jcaFactory
Returns the JCA algorithm identifier for this curve.- Returns:
- JCA signature algorithm string
-
signFixedLength
public int signFixedLength()Returns the fixed signature length for this curve in bytes.Lengths follow the IEEE P1363 format (raw concatenation of R and S).
- Returns:
- signature length in bytes
-
fromSignatureAlgorithmId
Resolves a standard external ECDSA signature algorithm identifier to the corresponding curve specification used by ZeroEcho.Standard names such as
SHA256withECDSAimply both the digest family and the fixed-size IEEE P1363 signature layout used internally by ZeroEcho. This helper makes the mapping explicit so callers do not need to duplicate it.- Parameters:
algorithmId- canonical external ECDSA signature algorithm identifier- Returns:
- matching curve specification, or
Optional.empty()when the identifier is not a supported ECDSA interop name
-
description
Returns a short, human-readable description of this object.The description should be concise and stable enough for logging or display purposes, while avoiding exposure of any sensitive information.
- Specified by:
descriptionin interfaceDescribable- Returns:
- non-null descriptive string
-