[−][src]Trait sequoia_openpgp::cert::amalgamation::ValidateAmalgamation
Embeds a policy and a reference time in an amalgamation.
This is used to turn a ComponentAmalgamation
into a
ValidComponentAmalgamation
, and a KeyAmalgamation
into a
ValidKeyAmalgamation
.
A certificate or a component is consider valid if:
-
It has a self signature that is live at time
t
. -
The policy considers it acceptable.
-
The certificate is valid.
Examples
use openpgp::cert::prelude::*; use openpgp::policy::{Policy, StandardPolicy}; const POLICY: &dyn Policy = &StandardPolicy::new(); fn f(ua: UserIDAmalgamation) -> openpgp::Result<()> { let ua = ua.with_policy(POLICY, None)?; // ... }
Associated Types
type V
The type returned by with_policy
.
This is either a ValidComponentAmalgamation
or
a ValidKeyAmalgamation
.
Required methods
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
Self: Sized,
T: Into<Option<SystemTime>>,
Self: Sized,
Uses the specified Policy
and reference time with the amalgamation.
If time
is None
, the current time is used.
Implementors
impl<'a, C> ValidateAmalgamation<'a, C> for ComponentAmalgamation<'a, C>
[src]
type V = ValidComponentAmalgamation<'a, C>
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
Self: Sized,
[src]
T: Into<Option<SystemTime>>,
Self: Sized,
impl<'a, C> ValidateAmalgamation<'a, C> for ValidComponentAmalgamation<'a, C>
[src]
type V = Self
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
Self: Sized,
[src]
T: Into<Option<SystemTime>>,
Self: Sized,
impl<'a, P> ValidateAmalgamation<'a, Key<P, PrimaryRole>> for PrimaryKeyAmalgamation<'a, P> where
P: 'a + KeyParts,
[src]
P: 'a + KeyParts,
type V = ValidPrimaryKeyAmalgamation<'a, P>
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
[src]
T: Into<Option<SystemTime>>,
impl<'a, P> ValidateAmalgamation<'a, Key<P, PrimaryRole>> for ValidPrimaryKeyAmalgamation<'a, P> where
P: 'a + KeyParts,
[src]
P: 'a + KeyParts,
type V = Self
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
Self: Sized,
[src]
T: Into<Option<SystemTime>>,
Self: Sized,
impl<'a, P> ValidateAmalgamation<'a, Key<P, SubordinateRole>> for SubordinateKeyAmalgamation<'a, P> where
P: 'a + KeyParts,
[src]
P: 'a + KeyParts,
type V = ValidSubordinateKeyAmalgamation<'a, P>
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
[src]
T: Into<Option<SystemTime>>,
impl<'a, P> ValidateAmalgamation<'a, Key<P, SubordinateRole>> for ValidSubordinateKeyAmalgamation<'a, P> where
P: 'a + KeyParts,
[src]
P: 'a + KeyParts,
type V = Self
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
Self: Sized,
[src]
T: Into<Option<SystemTime>>,
Self: Sized,
impl<'a, P> ValidateAmalgamation<'a, Key<P, UnspecifiedRole>> for ErasedKeyAmalgamation<'a, P> where
P: 'a + KeyParts,
[src]
P: 'a + KeyParts,
type V = ValidErasedKeyAmalgamation<'a, P>
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
[src]
T: Into<Option<SystemTime>>,
impl<'a, P> ValidateAmalgamation<'a, Key<P, UnspecifiedRole>> for ValidErasedKeyAmalgamation<'a, P> where
P: 'a + KeyParts,
[src]
P: 'a + KeyParts,
type V = Self
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
T: Into<Option<SystemTime>>,
Self: Sized,
[src]
T: Into<Option<SystemTime>>,
Self: Sized,