pub enum SecurityPolicy {
Permissive,
NistPost2030,
CryptrecCategory3Plus,
HybridRequired,
}Expand description
Security policy enforced across key generation, key import, and envelope encryption/decryption.
Variants§
Permissive
Allows all supported NIST PQC and hybrid KEMs (including Category 1 ML-KEM-512).
NistPost2030
Aligned with NIST IR 8547 (Post-2030): requires NIST-standardized PQC (FIPS 203 / 204 / 205) or a PQ/T hybrid built on it, and excludes quantum-vulnerable classical-only algorithms.
Currently accepts exactly the same algorithms as Self::Permissive. This is
intentional. IR 8547 deprecates and then disallows only quantum-vulnerable algorithms
(RSA, ECDSA, EdDSA, (EC)DH, …). It keeps every parameter set of ML-KEM, ML-DSA and
SLH-DSA, including Category 1 / 2 sets such as ML-KEM-512, and it allows hybrids. Every
algorithm this SDK implements is in that set: ML-KEM, ML-DSA, SLH-DSA, X-Wing and
MLDSA65-Ed25519-SHA512. Unlike Self::Permissive, this policy states the compliance
intent explicitly, and it must reject any classical-only algorithm, and any post-quantum
algorithm NIST has not standardized, that is added in the future. For a minimum security category, use Self::CryptrecCategory3Plus.
CryptrecCategory3Plus
Aligned with Japan CRYPTREC PQC List (2026) baseline: enforces NIST Category 3+
(ML-KEM-768, ML-KEM-1024, or X-Wing); rejects ML-KEM-512.
HybridRequired
Enforces PQ + Classical Hybrid (X-Wing) for migration windows requiring defense-in-depth
against both classical and quantum cryptanalysis.
Implementations§
Source§impl SecurityPolicy
impl SecurityPolicy
Sourcepub const fn validate_kem(self, alg: KemAlgorithm) -> Result<()>
pub const fn validate_kem(self, alg: KemAlgorithm) -> Result<()>
Checks whether alg satisfies this security policy.
Returns Error::PolicyViolation if alg is disallowed.
Sourcepub const fn default_kem(self) -> KemAlgorithm
pub const fn default_kem(self) -> KemAlgorithm
Recommended default KEM algorithm under this policy (X-Wing satisfies all policies).
Sourcepub const fn validate_signature(self, alg: SignatureAlgorithm) -> Result<()>
pub const fn validate_signature(self, alg: SignatureAlgorithm) -> Result<()>
Checks whether digital signature algorithm alg satisfies this security policy.
Returns Error::PolicyViolation if alg is disallowed.
Sourcepub const fn default_signature(self) -> SignatureAlgorithm
pub const fn default_signature(self) -> SignatureAlgorithm
Recommended default digital signature algorithm under this policy.
Returns SignatureAlgorithm::MlDsa65Ed25519 for Self::HybridRequired and
SignatureAlgorithm::MlDsa65 otherwise.