Package org.bouncycastle.crypto.constraints
package org.bouncycastle.crypto.constraints
Crypto-services-constraint framework: lets callers limit which cryptographic
primitives the lightweight API will produce (by key size, by allowlist, by purpose, or - for
the quantum-vulnerable public-key algorithms - by the NIST IR 8547 transition timetable).
Plugs into
CryptoServicesRegistrar. The post-quantum
algorithms report to the framework with the classical security strength NIST assigns to
their parameter set, so a BitsOfSecurityConstraint
of 192 refuses ML-KEM-512, ML-DSA-44 and the 128-bit SLH-DSA sets as it does a 2048-bit RSA key.
QuantumVulnerableConstraint can also log, or refuse
outright, the quantum-vulnerable algorithms, and the
Properties.CONSTRAINTS_QUANTUM_VULNERABLE property installs one as
the default constraint. The framework is described in section 5.8 of the specifications document.-
ClassesClassDescriptionBasic bits of security constraint.Legacy bits of security constraint.A constraint that refuses nothing and logs every service checked against it, at level INFO, with its name, bits of security and purpose.A constraint on the quantum-vulnerable public-key algorithms (RSA, DSA, DH, EC and the Edwards/Montgomery curve schemes, and the KEMs and key agreements built on them) following the transition timetable of NIST IR 8547: a quantum-vulnerable service is allowed until the deprecation date, allowed but logged between the deprecation date and the disallow date, and refused after the disallow date except for "legacy use" - verification and decryption of data protected earlier, which SP 800-131A continues to permit.Base class for a constraint, serves to provide storage for the set of exceptions (if any).