Skip to main content

KeyEstablishmentPolicy

Struct KeyEstablishmentPolicy 

Source
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: KemContentAuthentication

Separate permission for unauthenticated direct KEM content composition.

§max_encapsulation_operations: usize

Cumulative 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: usize

Cumulative conservative hash compression-block allowance per operation.

§max_owned_bytes: usize

Cumulative 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: usize

Maximum finite-field modulus width; capability alone grants no permission.

§minimum_dh_modulus_bits: usize

Product strength baseline, not XMLEnc’s 512-bit wire-format minimum. Legacy interoperability requires an explicit caller-selected lower value.

§minimum_dh_subgroup_bits: usize

Minimum prime-order subgroup width, independent of the modulus width.

§max_modular_work: usize

Cumulative modular work, in batches of up to 64 limb products. Charged conservatively for validation and exponentiation before their execution.

Implementations§

Source§

impl KeyEstablishmentPolicy

Source

pub fn validate(&self) -> Result<(), PolicyViolation>

Reject configuration exceeding implementation ceilings before any work.

Source

pub fn check_agreement( &self, algorithm: KeyAgreementAlgorithm, ) -> Result<(), PolicyViolation>

Check permission independently of the selected provider’s capability.

Source

pub fn check_encapsulation( &self, algorithm: KeyEncapsulationAlgorithm, ) -> Result<(), PolicyViolation>

Capability does not grant experimental key-establishment permission.

Source

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.

Source

pub fn check_derivation_digest( &self, digest: DigestAlgorithm, ) -> Result<(), PolicyViolation>

Digest permission is independent of the selected derivation mechanism.

Trait Implementations§

Source§

impl Clone for KeyEstablishmentPolicy

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KeyEstablishmentPolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for KeyEstablishmentPolicy

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.