[][src]Trait sequoia_openpgp::cert::amalgamation::ValidateAmalgamation

pub trait ValidateAmalgamation<'a, C: 'a>: Sealed {
    type V;
    fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V>
    where
        T: Into<Option<SystemTime>>,
        Self: Sized
; }

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.

Sealed trait

This trait is sealed and cannot be implemented for types outside this crate. Therefore it can be extended in a non-breaking way. If you want to implement the trait inside the crate you also need to implement the seal::Sealed marker trait.

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.

Loading content...

Required methods

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V> where
    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.

Loading content...

Implementors

impl<'a, C> ValidateAmalgamation<'a, C> for ComponentAmalgamation<'a, C>[src]

type V = ValidComponentAmalgamation<'a, C>

impl<'a, C> ValidateAmalgamation<'a, C> for ValidComponentAmalgamation<'a, C>[src]

type V = Self

impl<'a, P> ValidateAmalgamation<'a, Key<P, PrimaryRole>> for PrimaryKeyAmalgamation<'a, P> where
    P: 'a + KeyParts
[src]

type V = ValidPrimaryKeyAmalgamation<'a, P>

impl<'a, P> ValidateAmalgamation<'a, Key<P, PrimaryRole>> for ValidPrimaryKeyAmalgamation<'a, P> where
    P: 'a + KeyParts
[src]

type V = Self

impl<'a, P> ValidateAmalgamation<'a, Key<P, SubordinateRole>> for SubordinateKeyAmalgamation<'a, P> where
    P: 'a + KeyParts
[src]

type V = ValidSubordinateKeyAmalgamation<'a, P>

impl<'a, P> ValidateAmalgamation<'a, Key<P, SubordinateRole>> for ValidSubordinateKeyAmalgamation<'a, P> where
    P: 'a + KeyParts
[src]

type V = Self

impl<'a, P> ValidateAmalgamation<'a, Key<P, UnspecifiedRole>> for ErasedKeyAmalgamation<'a, P> where
    P: 'a + KeyParts
[src]

type V = ValidErasedKeyAmalgamation<'a, P>

impl<'a, P> ValidateAmalgamation<'a, Key<P, UnspecifiedRole>> for ValidErasedKeyAmalgamation<'a, P> where
    P: 'a + KeyParts
[src]

type V = Self

Loading content...