pub struct KeyEstablishmentPolicy {
pub encapsulation_algorithms: HashSet<KeyEncapsulationAlgorithm>,
pub kem_content_authentication: KemContentAuthentication,
pub max_encapsulation_operations: usize,
pub agreement_algorithms: Option<HashSet<KeyAgreementAlgorithm>>,
pub derivation_algorithms: Option<HashSet<KeyDerivationAlgorithm>>,
pub digest_algorithms: Option<HashSet<DigestAlgorithm>>,
pub max_hash_blocks: usize,
pub max_owned_bytes: usize,
pub max_dh_modulus_bits: usize,
pub minimum_dh_modulus_bits: usize,
pub minimum_dh_subgroup_bits: usize,
pub max_modular_work: usize,
}Expand description
Immutable permission and limits shared by encryption and decryption.
These are deployment decisions, not specification requirements. Requests supply private keys and expected party identities separately; XML input must never select this policy or reset its operation-wide budget.
Fields§
§encapsulation_algorithms: HashSet<KeyEncapsulationAlgorithm>Exact experimental KEM permissions. Empty denies all parameter sets.
kem_content_authentication: KemContentAuthenticationSeparate permission for unauthenticated direct KEM content composition.
max_encapsulation_operations: usizeCumulative KEM attempts; failed provider calls consume allowance too.
agreement_algorithms: Option<HashSet<KeyAgreementAlgorithm>>Exact agreement permissions. None permits only ECDH-ES and X25519.
derivation_algorithms: Option<HashSet<KeyDerivationAlgorithm>>Exact KDF permissions. None permits ConcatKDF/HKDF/PBKDF2, not legacy DH.
digest_algorithms: Option<HashSet<DigestAlgorithm>>Underlying digest permission, including HMAC PRFs. None permits SHA-2. SHA-1 requires an explicit grant even when required by a legacy profile.
max_hash_blocks: usizeCumulative conservative hash compression-block allowance per operation.
max_owned_bytes: usizeCumulative shared-secret, derived-key and finite-field validation allocations reserved before provider work, including boxed workspace. Failed attempts consume the allowance too; no retry may reset it.
max_dh_modulus_bits: usizeMaximum finite-field modulus width; capability alone grants no permission.
minimum_dh_modulus_bits: usizeProduct strength baseline, not XMLEnc’s 512-bit wire-format minimum. Legacy interoperability requires an explicit caller-selected lower value.
minimum_dh_subgroup_bits: usizeMinimum prime-order subgroup width, independent of the modulus width.
max_modular_work: usizeCumulative modular work, in batches of up to 64 limb products. Charged conservatively for validation and exponentiation before their execution.
Implementations§
Source§impl KeyEstablishmentPolicy
impl KeyEstablishmentPolicy
Sourcepub fn validate(&self) -> Result<(), PolicyViolation>
pub fn validate(&self) -> Result<(), PolicyViolation>
Reject configuration exceeding implementation ceilings before any work.
Sourcepub fn check_agreement(
&self,
algorithm: KeyAgreementAlgorithm,
) -> Result<(), PolicyViolation>
pub fn check_agreement( &self, algorithm: KeyAgreementAlgorithm, ) -> Result<(), PolicyViolation>
Check permission independently of the selected provider’s capability.
Sourcepub fn check_encapsulation(
&self,
algorithm: KeyEncapsulationAlgorithm,
) -> Result<(), PolicyViolation>
pub fn check_encapsulation( &self, algorithm: KeyEncapsulationAlgorithm, ) -> Result<(), PolicyViolation>
Capability does not grant experimental key-establishment permission.
Sourcepub fn check_derivation(
&self,
algorithm: KeyDerivationAlgorithm,
digest: DigestAlgorithm,
) -> Result<(), PolicyViolation>
pub fn check_derivation( &self, algorithm: KeyDerivationAlgorithm, digest: DigestAlgorithm, ) -> Result<(), PolicyViolation>
Check KDF and its underlying digest independently. An HMAC URI does not make a digest permission apply to signatures or certificate validation.
Sourcepub fn check_derivation_digest(
&self,
digest: DigestAlgorithm,
) -> Result<(), PolicyViolation>
pub fn check_derivation_digest( &self, digest: DigestAlgorithm, ) -> Result<(), PolicyViolation>
Digest permission is independent of the selected derivation mechanism.