Class MldsaKeyGenSpec
java.lang.Object
zeroecho.core.alg.mldsa.MldsaKeyGenSpec
- All Implemented Interfaces:
AlgorithmKeySpec
Specification for generating ML-DSA key pairs (FIPS 204).
ML-DSA is parameterized by a parameter set number (44/65/87). Bouncy Castle may also expose pre-hash variants (e.g., "with SHA-512") as separate parameter specs.
This spec intentionally restricts choices to the standardized ML-DSA parameter sets only.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumML-DSA parameter sets as defined by FIPS 204.static enumOptional pre-hash variant selection. -
Method Summary
Modifier and TypeMethodDescriptionstatic MldsaKeyGenSpecReturns the default ML-DSA key generation spec.Returns the explicit parameter constant override, if set.static MldsaKeyGenSpecof(String providerName, MldsaKeyGenSpec.ParameterSet parameterSet, MldsaKeyGenSpec.PreHash preHash) Creates a new specification with explicit algorithm parameters.Returns the ML-DSA parameter set.preHash()Returns the pre-hash selection.Returns the provider name used for key generation.Returns a copy of this specification with an explicit Bouncy Castle parameter constant override.
-
Method Details
-
defaultSpec
Returns the default ML-DSA key generation spec.- Returns:
- a singleton default specification (ML-DSA-65, no pre-hash)
-
of
public static MldsaKeyGenSpec of(String providerName, MldsaKeyGenSpec.ParameterSet parameterSet, MldsaKeyGenSpec.PreHash preHash) Creates a new specification with explicit algorithm parameters.- Parameters:
providerName- JCA provider name (typically"BC")parameterSet- parameter set (44/65/87)preHash- optional pre-hash selection- Returns:
- a new
MldsaKeyGenSpec
-
withExplicitParamConstant
Returns a copy of this specification with an explicit Bouncy Castle parameter constant override.This bypasses automatic mapping. The name must match a static field in
org.bouncycastle.jcajce.spec.MLDSAParameterSpec.- Parameters:
name- field name inMLDSAParameterSpec- Returns:
- a new
MldsaKeyGenSpecwith the override
-
providerName
Returns the provider name used for key generation.- Returns:
- provider name (never
null)
-
parameterSet
Returns the ML-DSA parameter set.- Returns:
- parameter set
-
preHash
Returns the pre-hash selection.- Returns:
- pre-hash selection
-
explicitParamConstant
Returns the explicit parameter constant override, if set.- Returns:
- constant name, or
nullif automatic mapping is used
-