[−][src]Struct sequoia_openpgp::cert::amalgamation::ValidComponentAmalgamation
A certificate's component and its associated data.
Methods from Deref<Target = ComponentAmalgamation<'a, C>>
pub fn parts_as_public(
&'a self
) -> &'a ComponentAmalgamation<'a, Key<PublicParts, R>>
[src]
&'a self
) -> &'a ComponentAmalgamation<'a, Key<PublicParts, R>>
Changes the key's parts tag to PublicParts
.
pub fn parts_as_secret(
&'a self
) -> Result<&'a ComponentAmalgamation<'a, Key<SecretParts, R>>>
[src]
&'a self
) -> Result<&'a ComponentAmalgamation<'a, Key<SecretParts, R>>>
Changes the key's parts tag to SecretParts
.
pub fn parts_as_unspecified(
&'a self
) -> &ComponentAmalgamation<'a, Key<UnspecifiedParts, R>>
[src]
&'a self
) -> &ComponentAmalgamation<'a, Key<UnspecifiedParts, R>>
Changes the key's parts tag to UnspecifiedParts
.
pub fn mark_role_primary_ref(
&'a self
) -> &'a ComponentAmalgamation<'a, Key<P, PrimaryRole>>
[src]
&'a self
) -> &'a ComponentAmalgamation<'a, Key<P, PrimaryRole>>
Changes the key's role tag to PrimaryRole
.
pub fn mark_role_subordinate_ref(
&'a self
) -> &'a ComponentAmalgamation<'a, Key<P, SubordinateRole>>
[src]
&'a self
) -> &'a ComponentAmalgamation<'a, Key<P, SubordinateRole>>
Changes the key's role tag to SubordinateRole
.
pub fn mark_role_unspecified_ref(
&'a self
) -> &'a ComponentAmalgamation<'a, Key<P, UnspecifiedRole>>
[src]
&'a self
) -> &'a ComponentAmalgamation<'a, Key<P, UnspecifiedRole>>
Changes the key's role tag to UnspecifiedRole
.
pub fn cert(&self) -> &'a Cert
[src]
Returns the certificate that the component came from.
pub fn bundle(&self) -> &'a ComponentBundle<C>
[src]
Returns this amalgamation's bundle.
Note: although Amalgamation
derefs to a
ComponentBundle
, this method provides a more accurate
lifetime, which is helpful when returning the reference
from a function.
Consider the following, which doesn't work:
use openpgp::cert::prelude::*; use openpgp::packet::prelude::*; cert.keys() .map(|ka| { let b : &KeyBundle<_, _> = &ka; b }) .collect::<Vec<&KeyBundle<_, _>>>();
Compiling the above code results in the following error:
b
returns a value referencing data owned by the current function
This error occurs because the Deref
trait says that the
lifetime of the target, i.e., &KeyBundle
, is
bounded by ka
's lifetime, whose lifetime is indeed
limited to the closure. But, &KeyBundle
is independent
of ka
! It is a copy of the KeyAmalgamation
's
reference to the KeyBundle
whose lifetime is 'a
.
Unfortunately, this can't be expressed using Deref
, but
it can be done using a separate method:
use openpgp::cert::prelude::*; use openpgp::packet::prelude::*; cert.keys().map(|ka| ka.bundle()) .collect::<Vec<&KeyBundle<_, _>>>();
pub fn component(&self) -> &'a C
[src]
Returns this amalgamation's component.
Note: although Amalgamation
derefs to a Component
(via
ComponentBundle
), this method provides a more accurate
lifetime, which is helpful when returning the reference
from a function.
Consider the following, which doesn't work:
use openpgp::cert::prelude::*; use openpgp::packet::prelude::*; cert.keys() .map(|ka| { let k : &Key<_, _> = &ka; k }) .collect::<Vec<&Key<_, _>>>();
Compiling the above code results in the following error:
k
returns a value referencing data owned by the current function
This error occurs because the Deref
trait says that the
lifetime of the target, i.e., &Key
, is bounded by
the ka
's lifetime, whose lifetime is indeed limited to
the closure. But, &Key
is independent of ka
! It is a
copy of the KeyAmalgamation
's reference to the Key
whose lifetime is 'a
. Unfortunately, this can't be
expressed using Deref
, but it can be done using a
separate method:
use openpgp::cert::prelude::*; use openpgp::packet::prelude::*; cert.keys().map(|ka| ka.key()) .collect::<Vec<&Key<_, _>>>();
pub fn user_attribute(&self) -> &'a UserAttribute
[src]
Returns a reference to the User Attribute.
Trait Implementations
impl<'a, C> Clone for ValidComponentAmalgamation<'a, C>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, C: Debug> Debug for ValidComponentAmalgamation<'a, C>
[src]
impl<'a, C> Deref for ValidComponentAmalgamation<'a, C>
[src]
type Target = ComponentAmalgamation<'a, C>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'a, C: 'a> From<ValidComponentAmalgamation<'a, C>> for ComponentAmalgamation<'a, C>
[src]
fn from(vca: ValidComponentAmalgamation<'a, C>) -> Self
[src]
impl<'a, C> Preferences<'a> for ValidComponentAmalgamation<'a, C>
[src]
fn preferred_symmetric_algorithms(&self) -> Option<&'a [SymmetricAlgorithm]>
[src]
fn preferred_hash_algorithms(&self) -> Option<&'a [HashAlgorithm]>
[src]
fn preferred_compression_algorithms(&self) -> Option<&'a [CompressionAlgorithm]>
[src]
fn preferred_aead_algorithms(&self) -> Option<&'a [AEADAlgorithm]>
[src]
fn key_server_preferences(&self) -> Option<KeyServerPreferences>
[src]
fn preferred_key_server(&self) -> Option<&'a [u8]>
[src]
fn features(&self) -> Option<Features>
[src]
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.
fn cert_revoked(&self) -> RevocationStatus<'a>
[src]
fn cert_alive(&self) -> Result<()>
[src]
fn map<F: Fn(&'a Signature) -> Option<T>, T>(&self, f: F) -> Option<T>
[src]
fn key_flags(&self) -> Option<KeyFlags>
[src]
fn has_any_key_flag<F>(&self, flags: F) -> bool where
F: Borrow<KeyFlags>,
[src]
F: Borrow<KeyFlags>,
fn for_certification(&self) -> bool
[src]
fn for_signing(&self) -> bool
[src]
fn for_authentication(&self) -> bool
[src]
fn for_storage_encryption(&self) -> bool
[src]
fn for_transport_encryption(&self) -> bool
[src]
fn key_validity_period(&self) -> Option<Duration>
[src]
fn revocation_keys(&self) -> Box<dyn Iterator<Item = &'a RevocationKey> + 'a>
[src]
impl<'a, C> ValidateAmalgamation<'a, C> for ValidComponentAmalgamation<'a, C>
[src]
type V = Self
The type returned by with_policy
.
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,
Auto Trait Implementations
impl<'a, C> !RefUnwindSafe for ValidComponentAmalgamation<'a, C>
impl<'a, C> !Send for ValidComponentAmalgamation<'a, C>
impl<'a, C> !Sync for ValidComponentAmalgamation<'a, C>
impl<'a, C> Unpin for ValidComponentAmalgamation<'a, C>
impl<'a, C> !UnwindSafe for ValidComponentAmalgamation<'a, C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,