Class HybridKexPolicy
java.lang.Object
zeroecho.sdk.hybrid.kex.HybridKexPolicy
Hybrid KEX policy helper for minimum security strength enforcement.
This policy applies additional hybrid-specific checks beyond per-algorithm policy validation. It is intended to prevent accidental downgrade combinations (for example a strong PQC leg combined with a too-weak classic leg, or an undersized OKM output).
What is checked
- Classic leg estimated strength in bits (algorithm id + key)
- PQC leg estimated strength in bits (algorithm id + key)
- Minimum OKM length (in bytes) for the intended usage
Strength estimates are provided by
SecurityStrengthAdvisor.estimateBits(String, Key) and are
conservative heuristics suitable for gating and coarse comparisons.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionHybridKexPolicy(int minClassicBits, int minPqcBits, int minOkmBytes) Creates a hybrid policy. -
Method Summary
Modifier and TypeMethodDescriptionvoidenforce(HybridKexProfile profile, AgreementContext classic, MessageAgreementContext pqc) Enforces the policy for a given hybrid configuration.
-
Constructor Details
-
HybridKexPolicy
public HybridKexPolicy(int minClassicBits, int minPqcBits, int minOkmBytes) Creates a hybrid policy.- Parameters:
minClassicBits- minimum estimated bits for classic leg (for example 128 or 192)minPqcBits- minimum estimated bits for PQC leg (for example 192)minOkmBytes- minimum OKM output length in bytes (for example 32)
-
-
Method Details
-
enforce
public void enforce(HybridKexProfile profile, AgreementContext classic, MessageAgreementContext pqc) Enforces the policy for a given hybrid configuration.- Parameters:
profile- hybrid profileclassic- classic agreement contextpqc- PQC message agreement context- Throws:
NullPointerException- if any argument is nullIllegalArgumentException- if policy is violated
-