[−][src]Trait sequoia_openpgp::cert::amalgamation::ValidAmalgamation
An amalgamation with a policy and a reference time.
In a certain sense, a ValidAmalgamation
provides a view of an
Amalgamation
as it was at a particular time. That is,
signatures and components that are not valid at the reference
time, because they were created after the reference time, for
instance, are ignored.
The methods exposed by a ValidAmalgamation
are similar to those
exposed by an Amalgamation
, but the policy and reference time
are taken from the ValidAmalgamation
. This helps prevent using
different policies or different reference times when using a
component, which can easily happen when the checks span multiple
functions.
Required methods
fn cert(&self) -> &ValidCert<'a>
Returns the certificate.
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 binding_signature(&self) -> &'a Signature
Returns the component's binding signature as of the reference time.
fn direct_key_signature(&self) -> Result<&'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.
fn key_expiration_time(&self) -> Option<SystemTime>
Returns the key's expiration time as of the amalgamation's reference time.
If this function returns None
, the key does not expire.
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.
Provided methods
fn cert_revoked(&self) -> RevocationStatus<'a>
Returns the certificate's revocation status as of the amalgamation's reference time.
fn cert_alive(&self) -> Result<()>
Returns whether the certificate is alive as of the amalgamation'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 amalgamation'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>,
F: Borrow<KeyFlags>,
Returns whether the key has at least one of the specified key flags as of the amalgamation'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 amalgamation'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 amalgamation'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 amalgamation'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_validity_period(&self) -> Option<Duration>
Returns the key's expiration time as of the amalgamation'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_keys(&self) -> Box<dyn Iterator<Item = &'a RevocationKey> + 'a>
Returns the value of the Revocation Key subpacket, which contains a designated revoker.
Considers both the binding signature and the direct key signature.
Implementors
impl<'a, C> ValidAmalgamation<'a, C> for ValidComponentAmalgamation<'a, C>
[src]
fn cert(&self) -> &ValidCert<'a>
[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 binding_signature(&self) -> &'a Signature
[src]
Returns the component's binding signature as of the reference time.
fn direct_key_signature(&self) -> Result<&'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.
fn key_expiration_time(&self) -> Option<SystemTime>
[src]
Returns the key's expiration time as of the amalgamtion's reference time.
If this function returns None
, the key does not expire.
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.
impl<'a, P, R, R2> ValidAmalgamation<'a, Key<P, R>> for ValidKeyAmalgamation<'a, P, R, R2> where
P: 'a + KeyParts,
R: 'a + KeyRole,
R2: Copy,
Self: PrimaryKey<'a, P, R>,
[src]
P: 'a + KeyParts,
R: 'a + KeyRole,
R2: Copy,
Self: PrimaryKey<'a, P, R>,