[][src]Trait sequoia_openpgp::cert::components::Amalgamation

pub trait Amalgamation<'a> {
    fn cert(&self) -> &'a Cert;
fn time(&self) -> SystemTime;
fn policy(&self) -> &'a dyn Policy;
fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self>
    where
        Self: Sized,
        T: Into<Option<SystemTime>>
;
fn binding_signature(&self) -> &'a Signature;
fn direct_key_signature(&self) -> Option<&'a Signature>;
fn revoked(&self) -> RevocationStatus<'a>; fn cert_revoked(&self) -> RevocationStatus<'a> { ... }
fn cert_alive(&self) -> Result<()> { ... }
fn map<F: Fn(&'a Signature) -> Option<T>, T>(&self, f: F) -> Option<T> { ... }
fn key_flags(&self) -> Option<KeyFlags> { ... }
fn has_any_key_flag<F>(&self, flags: F) -> bool
    where
        F: Borrow<KeyFlags>
, { ... }
fn for_certification(&self) -> bool { ... }
fn for_signing(&self) -> bool { ... }
fn for_authentication(&self) -> bool { ... }
fn for_storage_encryption(&self) -> bool { ... }
fn for_transport_encryption(&self) -> bool { ... }
fn key_expiration_time(&self) -> Option<Duration> { ... }
fn revocation_key(&self) -> Option<(u8, PublicKeyAlgorithm, Fingerprint)> { ... } }

Represents a component under a given policy.

Required methods

fn cert(&self) -> &'a Cert

Returns the certificate that the component came from.

fn time(&self) -> SystemTime

Returns the amalgamation's reference time.

For queries that are with respect to a point in time, this determines that point in time. For instance, if a component is created at t_c and expires at t_e, then ValidComponentAmalgamation::alive will return true if the reference time is greater than or equal to t_c and less than t_e.

fn policy(&self) -> &'a dyn Policy

Returns the amalgamation's policy.

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self> where
    Self: Sized,
    T: Into<Option<SystemTime>>, 

Changes the amalgamation's policy.

If time is None, the current time is used.

fn binding_signature(&self) -> &'a Signature

Returns the component's binding signature as of the reference time.

fn direct_key_signature(&self) -> Option<&'a Signature>

Returns the Certificate's direct key signature as of the reference time, if any.

Subpackets on direct key signatures apply to all components of the certificate.

fn revoked(&self) -> RevocationStatus<'a>

Returns the component's revocation status as of the amalgamation's reference time.

Note: this does not return whether the certificate is valid.

Loading content...

Provided methods

fn cert_revoked(&self) -> RevocationStatus<'a>

Returns the certificate's revocation status as of the amalgamtion's reference time.

fn cert_alive(&self) -> Result<()>

Returns whether the certificateis alive as of the amalgamtion's reference time.

fn map<F: Fn(&'a Signature) -> Option<T>, T>(&self, f: F) -> Option<T>

Maps the given function over binding and direct key signature.

Makes f consider both the binding signature and the direct key signature. Information in the binding signature takes precedence over the direct key signature. See also Section 5.2.3.3 of RFC 4880.

fn key_flags(&self) -> Option<KeyFlags>

Returns the key's key flags as of the amalgamtion's reference time.

Considers both the binding signature and the direct key signature. Information in the binding signature takes precedence over the direct key signature. See also Section 5.2.3.3 of RFC 4880.

fn has_any_key_flag<F>(&self, flags: F) -> bool where
    F: Borrow<KeyFlags>, 

Returns whether the key has at least one of the specified key flags as of the amalgamtion's reference time.

Key flags are computed as described in key_flags().

fn for_certification(&self) -> bool

Returns whether key is certification capable as of the amalgamtion's reference time.

Key flags are computed as described in key_flags().

fn for_signing(&self) -> bool

Returns whether key is signing capable as of the amalgamtion's reference time.

Key flags are computed as described in key_flags().

fn for_authentication(&self) -> bool

Returns whether key is authentication capable as of the amalgamtion's reference time.

Key flags are computed as described in key_flags().

fn for_storage_encryption(&self) -> bool

Returns whether key is intended for storage encryption as of the amalgamtion's reference time.

Key flags are computed as described in key_flags().

fn for_transport_encryption(&self) -> bool

Returns whether key is intended for transport encryption as of the amalgamtion's reference time.

Key flags are computed as described in key_flags().

fn key_expiration_time(&self) -> Option<Duration>

Returns the key's expiration time as of the amalgamtion's reference time.

Considers both the binding signature and the direct key signature. Information in the binding signature takes precedence over the direct key signature. See also Section 5.2.3.3 of RFC 4880.

fn revocation_key(&self) -> Option<(u8, PublicKeyAlgorithm, Fingerprint)>

Returns the value of the Revocation Key subpacket, which contains a designated revoker.

Considers both the binding signature and the direct key signature. Information in the binding signature takes precedence over the direct key signature. See also Section 5.2.3.3 of RFC 4880.

Loading content...

Implementors

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

fn time(&self) -> SystemTime[src]

Returns the amalgamation's reference time.

For queries that are with respect to a point in time, this determines that point in time. For instance, if a component is created at t_c and expires at t_e, then ValidComponentAmalgamation::alive will return true if the reference time is greater than or equal to t_c and less than t_e.

fn policy(&self) -> &'a dyn Policy[src]

Returns the amalgamation's policy.

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self> where
    T: Into<Option<SystemTime>>, 
[src]

Changes the amalgamation's policy.

If time is None, the current time is used.

fn binding_signature(&self) -> &'a Signature[src]

Returns the component's binding signature as of the reference time.

fn direct_key_signature(&self) -> Option<&'a Signature>[src]

Returns the Certificate's direct key signature as of the reference time, if any.

Subpackets on direct key signatures apply to all components of the certificate.

fn revoked(&self) -> RevocationStatus<'a>[src]

Returns the component's revocation status as of the amalgamation's reference time.

Note: this does not return whether the certificate is valid.

impl<'a, P: 'a + KeyParts> Amalgamation<'a> for ValidKeyAmalgamation<'a, P>[src]

fn time(&self) -> SystemTime[src]

Returns the amalgamation's reference time.

For queries that are with respect to a point in time, this determines that point in time. For instance, if a key is created at t_c and expires at t_e, then ValidKeyAmalgamation::alive will return true if the reference time is greater than or equal to t_c and less than t_e.

fn policy(&self) -> &'a dyn Policy[src]

Returns the amalgamation's policy.

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self> where
    T: Into<Option<SystemTime>>, 
[src]

Changes the amalgamation's policy.

If time is None, the current time is used.

fn binding_signature(&self) -> &'a Signature[src]

Returns the key's binding signature as of the reference time, if any.

fn direct_key_signature(&self) -> Option<&'a Signature>[src]

Returns the Certificate's direct key signature as of the reference time, if any.

Subpackets on direct key signatures apply to all components of the certificate.

fn revoked(&self) -> RevocationStatus<'a>[src]

Returns the key's revocation status as of the amalgamation's reference time.

Note: this function only returns whether the key has been revoked, it does not return whether the certificate has been revoked.

impl<'a, P: 'a + KeyParts> Amalgamation<'a> for ValidPrimaryKeyAmalgamation<'a, P>[src]

fn time(&self) -> SystemTime[src]

Returns the amalgamation's reference time.

For queries that are with respect to a point in time, this determines that point in time. For instance, if a key is created at t_c and expires at t_e, then ValidKeyAmalgamation::alive will return true if the reference time is greater than or equal to t_c and less than t_e.

fn policy(&self) -> &'a dyn Policy[src]

Returns the amalgamation's policy.

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self> where
    T: Into<Option<SystemTime>>, 
[src]

Changes the amalgamation's policy.

If time is None, the current time is used.

fn binding_signature(&self) -> &'a Signature[src]

Returns the key's binding signature as of the reference time, if any.

fn direct_key_signature(&self) -> Option<&'a Signature>[src]

Returns the Certificate's direct key signature as of the reference time, if any.

Subpackets on direct key signatures apply to all components of the certificate.

fn revoked(&self) -> RevocationStatus<'a>[src]

Returns the key's revocation status as of the amalgamation's reference time.

Note: this function only returns whether the key has been revoked, it does not return whether the certificate has been revoked.

Loading content...