public class QuantumVulnerableConstraint extends ServicesConstraint
The no-argument constructor applies the NIST dates: deprecated after 2030, disallowed after 2035. Any other policy is expressed by passing the dates explicitly; a date in the past deprecates or disallows the algorithms immediately, a date far in the future turns that step off. Services named in the exceptions set are not checked at all.
Three fixed policies are available without dates: logOnly() logs every use of a
quantum-vulnerable service and refuses nothing, legacyUseOnly() refuses new protection
(key generation, signing, encryption and key agreement) while allowing verification and
decryption, and rejectAll() refuses every use, legacy use included. One of them, or the
NIST timetable, can also be installed as the default constraint through the
Properties.CONSTRAINTS_QUANTUM_VULNERABLE property; see
forPolicy(String).
Which services count as quantum-vulnerable is decided by
ConstraintUtils.isQuantumVulnerable(CryptoServiceProperties); the post-quantum
algorithms (ML-KEM, ML-DSA, SLH-DSA, LMS/HSS, XMSS and the candidates) are never affected. Note
that a service reporting the purpose CryptoServicePurpose.ANY cannot be told from a
legacy use and is treated as one where legacy use is allowed.
| Modifier and Type | Field and Description |
|---|---|
static java.util.Date |
NIST_DEPRECATED_AFTER
1 January 2031, 00:00 UTC: NIST IR 8547 deprecates the quantum-vulnerable public-key
algorithms after 2030.
|
static java.util.Date |
NIST_DISALLOWED_AFTER
1 January 2036, 00:00 UTC: NIST IR 8547 disallows the quantum-vulnerable public-key
algorithms after 2035.
|
static java.lang.String |
POLICY_LEGACY
The policy name selecting
legacyUseOnly(). |
static java.lang.String |
POLICY_LOG
The policy name selecting
logOnly(). |
static java.lang.String |
POLICY_NIST
The policy name selecting the NIST IR 8547 timetable,
QuantumVulnerableConstraint(). |
static java.lang.String |
POLICY_NONE
The policy name selecting no constraint at all.
|
static java.lang.String |
POLICY_REJECT
The policy name selecting
rejectAll(). |
LOG| Constructor and Description |
|---|
QuantumVulnerableConstraint()
Apply the NIST IR 8547 timetable: deprecated after 2030, disallowed after 2035.
|
QuantumVulnerableConstraint(java.util.Date deprecatedAfter,
java.util.Date disallowedAfter)
Apply an explicit timetable.
|
QuantumVulnerableConstraint(java.util.Date deprecatedAfter,
java.util.Date disallowedAfter,
boolean allowLegacyUse,
java.util.Set<java.lang.String> exceptions)
Apply an explicit timetable, choosing whether legacy use survives the disallow date.
|
QuantumVulnerableConstraint(java.util.Date deprecatedAfter,
java.util.Date disallowedAfter,
java.util.Set<java.lang.String> exceptions)
Apply an explicit timetable with a set of service names that are not checked.
|
QuantumVulnerableConstraint(java.util.Set<java.lang.String> exceptions)
Apply the NIST IR 8547 timetable with a set of service names that are not checked.
|
| Modifier and Type | Method and Description |
|---|---|
void |
check(CryptoServiceProperties service) |
static QuantumVulnerableConstraint |
forPolicy(java.lang.String policy)
Return the constraint a policy name selects:
POLICY_NIST for the NIST IR 8547
timetable, POLICY_LOG for logOnly(), POLICY_LEGACY for
legacyUseOnly(), POLICY_REJECT for rejectAll() and
POLICY_NONE for no constraint. |
static QuantumVulnerableConstraint |
legacyUseOnly()
Return a constraint that refuses a quantum-vulnerable service for key generation, signing,
encryption and key agreement, and allows it, logged, for verification and decryption - the
SP 800-131A "legacy use".
|
static QuantumVulnerableConstraint |
legacyUseOnly(java.util.Set<java.lang.String> exceptions)
Return a constraint that refuses a quantum-vulnerable service for key generation, signing,
encryption and key agreement, and allows it, logged, for verification and decryption - the
SP 800-131A "legacy use".
|
static QuantumVulnerableConstraint |
logOnly()
Return a constraint that logs every use of a quantum-vulnerable service, at level INFO, and
refuses nothing.
|
static QuantumVulnerableConstraint |
logOnly(java.util.Set<java.lang.String> exceptions)
Return a constraint that logs every use of a quantum-vulnerable service, at level INFO, and
refuses nothing.
|
static QuantumVulnerableConstraint |
rejectAll()
Return a constraint that refuses every use of a quantum-vulnerable service, verification
and decryption included.
|
static QuantumVulnerableConstraint |
rejectAll(java.util.Set<java.lang.String> exceptions)
Return a constraint that refuses every use of a quantum-vulnerable service, verification
and decryption included.
|
isExceptionpublic static final java.util.Date NIST_DEPRECATED_AFTER
public static final java.util.Date NIST_DISALLOWED_AFTER
public static final java.lang.String POLICY_NIST
QuantumVulnerableConstraint().public static final java.lang.String POLICY_LOG
logOnly().public static final java.lang.String POLICY_LEGACY
legacyUseOnly().public static final java.lang.String POLICY_REJECT
rejectAll().public static final java.lang.String POLICY_NONE
public QuantumVulnerableConstraint()
public QuantumVulnerableConstraint(java.util.Set<java.lang.String> exceptions)
exceptions - set of service names which are exceptions to the rules.public QuantumVulnerableConstraint(java.util.Date deprecatedAfter,
java.util.Date disallowedAfter)
deprecatedAfter - the instant from which use of a quantum-vulnerable service is logged.disallowedAfter - the instant from which a quantum-vulnerable service is refused for
anything other than legacy use.public QuantumVulnerableConstraint(java.util.Date deprecatedAfter,
java.util.Date disallowedAfter,
java.util.Set<java.lang.String> exceptions)
deprecatedAfter - the instant from which use of a quantum-vulnerable service is logged.disallowedAfter - the instant from which a quantum-vulnerable service is refused for
anything other than legacy use.exceptions - set of service names which are exceptions to the rules.public QuantumVulnerableConstraint(java.util.Date deprecatedAfter,
java.util.Date disallowedAfter,
boolean allowLegacyUse,
java.util.Set<java.lang.String> exceptions)
deprecatedAfter - the instant from which use of a quantum-vulnerable service is logged.disallowedAfter - the instant from which a quantum-vulnerable service is refused.allowLegacyUse - true if verification and decryption are still allowed after the disallow
date, false if they are refused along with everything else.exceptions - set of service names which are exceptions to the rules.public static QuantumVulnerableConstraint logOnly()
public static QuantumVulnerableConstraint logOnly(java.util.Set<java.lang.String> exceptions)
exceptions - set of service names which are not logged.public static QuantumVulnerableConstraint legacyUseOnly()
public static QuantumVulnerableConstraint legacyUseOnly(java.util.Set<java.lang.String> exceptions)
exceptions - set of service names which are not checked.public static QuantumVulnerableConstraint rejectAll()
public static QuantumVulnerableConstraint rejectAll(java.util.Set<java.lang.String> exceptions)
exceptions - set of service names which are not checked.public static QuantumVulnerableConstraint forPolicy(java.lang.String policy)
POLICY_NIST for the NIST IR 8547
timetable, POLICY_LOG for logOnly(), POLICY_LEGACY for
legacyUseOnly(), POLICY_REJECT for rejectAll() and
POLICY_NONE for no constraint. The names are case-insensitive and surrounding white
space is ignored. This is how the value of the
Properties.CONSTRAINTS_QUANTUM_VULNERABLE property is read.policy - the policy name.POLICY_NONE.java.lang.IllegalArgumentException - if the name is not one of the above.public void check(CryptoServiceProperties service)