Class SphincsPlusKeyGenBuilder

java.lang.Object
zeroecho.core.alg.sphincsplus.SphincsPlusKeyGenBuilder
All Implemented Interfaces:
AsymmetricKeyPairGenerator<SphincsPlusKeyGenSpec>

public final class SphincsPlusKeyGenBuilder extends Object implements AsymmetricKeyPairGenerator<SphincsPlusKeyGenSpec>
Key pair builder for the SPHINCS+ post-quantum signature scheme.

SphincsPlusKeyGenBuilder integrates with the Bouncy Castle BC provider to generate pure SLH-DSA key pairs. It maps high-level SphincsPlusKeyGenSpec parameters (hash family, security level, variant, and mode) to the appropriate org.bouncycastle.jcajce.spec.SLHDSAParameterSpec constant. Reflection is used to avoid a hard dependency on all parameter variants.

The exact supported operation is generateKeyPair(SphincsPlusKeyGenSpec). Public and private import are registered separately for SphincsPlusPublicKeySpec and SphincsPlusPrivateKeySpec.

Example

SphincsPlusKeyGenSpec spec =
    SphincsPlusKeyGenSpec.of("BC", SphincsPlusKeyGenSpec.Hash.SHA2,
        SphincsPlusKeyGenSpec.Security.L1_128, SphincsPlusKeyGenSpec.Variant.SMALL,
        SphincsPlusKeyGenSpec.Mode.SIMPLE);

KeyPair kp = new SphincsPlusKeyGenBuilder().generateKeyPair(spec);
Since:
1.0