pub struct AlgorithmPolicy<'a> { /* private fields */ }Expand description
Closed algorithm admission policy for a verification context.
Implementations§
Source§impl<'a> AlgorithmPolicy<'a>
impl<'a> AlgorithmPolicy<'a>
Sourcepub const fn new(
admitted: &'a [SignatureAlgorithm],
) -> Result<Self, VerificationError>
pub const fn new( admitted: &'a [SignatureAlgorithm], ) -> Result<Self, VerificationError>
Creates an algorithm admission policy from an explicit allow-list.
Admitting several algorithms lets the sender choose any admitted algorithm, including the weakest one. High-assurance deployments should admit exactly one algorithm for an operation class unless downgrade behavior is explicitly part of the profile security contract.
Sourcepub const fn admits(&self, algorithm: SignatureAlgorithm) -> bool
pub const fn admits(&self, algorithm: SignatureAlgorithm) -> bool
Returns true when the algorithm is admitted by this policy.
Trait Implementations§
Source§impl<'a> Clone for AlgorithmPolicy<'a>
impl<'a> Clone for AlgorithmPolicy<'a>
Source§fn clone(&self) -> AlgorithmPolicy<'a>
fn clone(&self) -> AlgorithmPolicy<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for AlgorithmPolicy<'a>
Source§impl<'a> Debug for AlgorithmPolicy<'a>
impl<'a> Debug for AlgorithmPolicy<'a>
impl<'a> Eq for AlgorithmPolicy<'a>
Source§impl<'a> PartialEq for AlgorithmPolicy<'a>
impl<'a> PartialEq for AlgorithmPolicy<'a>
Source§fn eq(&self, other: &AlgorithmPolicy<'a>) -> bool
fn eq(&self, other: &AlgorithmPolicy<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for AlgorithmPolicy<'a>
Auto Trait Implementations§
impl<'a> Freeze for AlgorithmPolicy<'a>
impl<'a> RefUnwindSafe for AlgorithmPolicy<'a>
impl<'a> Send for AlgorithmPolicy<'a>
impl<'a> Sync for AlgorithmPolicy<'a>
impl<'a> Unpin for AlgorithmPolicy<'a>
impl<'a> UnsafeUnpin for AlgorithmPolicy<'a>
impl<'a> UnwindSafe for AlgorithmPolicy<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more