Struct sequoia_openpgp::policy::NullPolicy

source ·
pub struct NullPolicy {}
Expand description

The Null Policy.

Danger, here be dragons.

This policy imposes no additional policy, i.e., accepts everything. This includes the MD5 hash algorithm, and SED packets.

The Null policy has a limited set of valid use cases, e.g., packet statistics. For other purposes, it is more advisable to use the StandardPolicy and adjust it by selectively allowing items considered insecure by default, e.g., via StandardPolicy::accept_hash function. If this is still too inflexible consider creating a specialized policy based on the StandardPolicy as the example for StandardPolicy illustrates.

Implementations§

source§

impl NullPolicy

source

pub const fn new() -> Self

Instantiates a new NullPolicy.

Trait Implementations§

source§

impl Debug for NullPolicy

source§

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

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

impl Policy for NullPolicy

source§

fn signature(&self, _sig: &Signature, _sec: HashAlgoSecurity) -> Result<()>

Returns an error if the signature violates the policy. Read more
source§

fn key(&self, _ka: &ValidErasedKeyAmalgamation<'_, PublicParts>) -> Result<()>

Returns an error if the key violates the policy. Read more
source§

fn symmetric_algorithm(&self, _algo: SymmetricAlgorithm) -> Result<()>

Returns an error if the symmetric encryption algorithm violates the policy. Read more
source§

fn aead_algorithm(&self, _algo: AEADAlgorithm) -> Result<()>

Returns an error if the AEAD mode violates the policy. Read more
source§

fn packet(&self, _packet: &Packet) -> Result<()>

Returns an error if the packet violates the policy. 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<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> 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

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T