[−][src]Enum sequoia_openpgp::packet::Key
Holds a public key, public subkey, private key or private subkey packet.
See Section 5.5 of RFC 4880 for details.
Note: This enum cannot be exhaustively matched to allow future extensions.
A note on equality
Two Key
packets are considered equal if their serialized form is
equal. Notably this includes the secret key material, but
excludes the KeyParts
and KeyRole
marker traits.
To compare only the public bits of Key
packets, use
Key::public_eq
.
Variants
V4(Key4<P, R>)
Key packet version 4.
Implementations
impl<P: KeyParts, R: KeyRole> Key<P, R>
[src]
pub fn encrypt(&self, data: &SessionKey) -> Result<Ciphertext>
[src]
Encrypts the given data with this key.
pub fn verify(&self, sig: &Signature, digest: &[u8]) -> Result<()>
[src]
Verifies the given signature.
impl<P, R> Key<P, R> where
P: KeyParts,
R: KeyRole,
[src]
P: KeyParts,
R: KeyRole,
pub fn parts_into_public(self) -> Key<PublicParts, R>
[src]
Changes the key's parts tag to PublicParts
.
pub fn parts_as_public(&self) -> &Key<PublicParts, R>
[src]
Changes the key's parts tag to PublicParts
.
pub fn parts_into_secret(self) -> Result<Key<SecretParts, R>>
[src]
Changes the key's parts tag to SecretParts
.
pub fn parts_as_secret(&self) -> Result<&Key<SecretParts, R>>
[src]
Changes the key's parts tag to SecretParts
.
pub fn parts_into_unspecified(self) -> Key<UnspecifiedParts, R>
[src]
Changes the key's parts tag to UnspecifiedParts
.
pub fn parts_as_unspecified(&self) -> &Key<UnspecifiedParts, R>
[src]
Changes the key's parts tag to UnspecifiedParts
.
impl<P, R> Key<P, R> where
P: KeyParts,
R: KeyRole,
[src]
P: KeyParts,
R: KeyRole,
pub fn mark_role_primary(self) -> Key<P, PrimaryRole>
[src]
Changes the key's role tag to PrimaryRole
.
pub fn mark_role_primary_ref(&self) -> &Key<P, PrimaryRole>
[src]
Changes the key's role tag to PrimaryRole
.
pub fn mark_role_subordinate(self) -> Key<P, SubordinateRole>
[src]
Changes the key's role tag to SubordinateRole
.
pub fn mark_role_subordinate_ref(&self) -> &Key<P, SubordinateRole>
[src]
Changes the key's role tag to SubordinateRole
.
pub fn mark_role_unspecified(self) -> Key<P, UnspecifiedRole>
[src]
Changes the key's role tag to UnspecifiedRole
.
pub fn mark_role_unspecified_ref(&self) -> &Key<P, UnspecifiedRole>
[src]
Changes the key's role tag to UnspecifiedRole
.
impl<P: KeyParts, R: KeyRole> Key<P, R>
[src]
pub fn version(&self) -> u8
[src]
Gets the version.
pub fn public_cmp<PB, RB>(&self, b: &Key<PB, RB>) -> Ordering where
PB: KeyParts,
RB: KeyRole,
[src]
PB: KeyParts,
RB: KeyRole,
Compares the public bits of two keys.
This returns Ordering::Equal if the public MPIs, version,
creation time and algorithm of the two Key
s match. This
does not consider the packet's encoding, packet's tag or the
secret key material.
pub fn public_eq<PB, RB>(&self, b: &Key<PB, RB>) -> bool where
PB: KeyParts,
RB: KeyRole,
[src]
PB: KeyParts,
RB: KeyRole,
This method tests for self and other values to be equal modulo the secret bits.
This returns true if the public MPIs, creation time and
algorithm of the two Key
s match. This does not consider
the packet's encoding, packet's tag or the secret key
material.
impl<R: KeyRole> Key<SecretParts, R>
[src]
pub fn into_keypair(self) -> Result<KeyPair>
[src]
Creates a new key pair from a Key packet with an unencrypted secret key.
Errors
Fails if the secret key is missing, or encrypted.
impl<R: KeyRole> Key<PublicParts, R>
[src]
Secret key handling.
pub fn take_secret(self) -> (Key<PublicParts, R>, Option<SecretKeyMaterial>)
[src]
Takes the key packet's SecretKeyMaterial
, if any.
pub fn add_secret(
self,
secret: SecretKeyMaterial
) -> (Key<SecretParts, R>, Option<SecretKeyMaterial>)
[src]
self,
secret: SecretKeyMaterial
) -> (Key<SecretParts, R>, Option<SecretKeyMaterial>)
Adds SecretKeyMaterial
to the packet, returning the old if
any.
impl<R: KeyRole> Key<UnspecifiedParts, R>
[src]
Secret key handling.
pub fn take_secret(self) -> (Key<PublicParts, R>, Option<SecretKeyMaterial>)
[src]
Takes the key packet's SecretKeyMaterial
, if any.
pub fn add_secret(
self,
secret: SecretKeyMaterial
) -> (Key<SecretParts, R>, Option<SecretKeyMaterial>)
[src]
self,
secret: SecretKeyMaterial
) -> (Key<SecretParts, R>, Option<SecretKeyMaterial>)
Adds SecretKeyMaterial
to the packet, returning the old if
any.
impl<R: KeyRole> Key<SecretParts, R>
[src]
Secret key handling.
pub fn take_secret(self) -> (Key<PublicParts, R>, SecretKeyMaterial)
[src]
Takes the key packet's SecretKeyMaterial
.
pub fn add_secret(
self,
secret: SecretKeyMaterial
) -> (Key<SecretParts, R>, SecretKeyMaterial)
[src]
self,
secret: SecretKeyMaterial
) -> (Key<SecretParts, R>, SecretKeyMaterial)
Adds SecretKeyMaterial
to the packet, returning the old.
impl<P: KeyParts> Key<P, SubordinateRole>
[src]
pub fn bind(
&self,
signer: &mut dyn Signer,
cert: &Cert,
signature: Builder
) -> Result<Signature>
[src]
&self,
signer: &mut dyn Signer,
cert: &Cert,
signature: Builder
) -> Result<Signature>
Creates a binding signature.
The signature binds this userid to cert
. signer
will be used
to create a signature using signature
as builder.
Thehash_algo
defaults to SHA512, creation_time
to the
current time.
This function adds a creation time subpacket, a issuer fingerprint subpacket, and a issuer subpacket to the signature.
Example
This example demonstrates how to bind this key to a Cert. Note
that in general, the CertBuilder
is a better way to add
subkeys to a Cert.
use sequoia_openpgp::policy::StandardPolicy; let p = &StandardPolicy::new(); // Generate a Cert, and create a keypair from the primary key. let (cert, _) = CertBuilder::new().generate()?; let mut keypair = cert.primary_key().key().clone() .parts_into_secret()?.into_keypair()?; // Let's add an encryption subkey. let flags = KeyFlags::default().set_storage_encryption(true); assert_eq!(cert.keys().with_policy(p, None).alive().revoked(false) .key_flags(&flags).count(), 0); // Generate a subkey and a binding signature. let subkey: Key<_, key::SubordinateRole> = Key4::generate_ecc(false, Curve::Cv25519)? .into(); let builder = signature::Builder::new(SignatureType::SubkeyBinding) .set_key_flags(&flags)?; let binding = subkey.bind(&mut keypair, &cert, builder)?; // Now merge the key and binding signature into the Cert. let cert = cert.merge_packets(vec![subkey.into(), binding.into()])?; // Check that we have an encryption subkey. assert_eq!(cert.keys().with_policy(p, None).alive().revoked(false) .key_flags(flags).count(), 1);
Methods from Deref<Target = Key4<P, R>>
pub fn parts_as_public(&self) -> &Key4<PublicParts, R>
[src]
Changes the key's parts tag to PublicParts
.
pub fn parts_as_secret(&self) -> Result<&Key4<SecretParts, R>>
[src]
Changes the key's parts tag to SecretParts
.
pub fn parts_as_unspecified(&self) -> &Key4<UnspecifiedParts, R>
[src]
Changes the key's parts tag to UnspecifiedParts
.
pub fn mark_role_primary_ref(&self) -> &Key4<P, PrimaryRole>
[src]
Changes the key's role tag to PrimaryRole
.
pub fn mark_role_subordinate_ref(&self) -> &Key4<P, SubordinateRole>
[src]
Changes the key's role tag to SubordinateRole
.
pub fn mark_role_unspecified_ref(&self) -> &Key4<P, UnspecifiedRole>
[src]
Changes the key's role tag to UnspecifiedRole
.
pub fn public_cmp<PB, RB>(&self, b: &Key4<PB, RB>) -> Ordering where
PB: KeyParts,
RB: KeyRole,
[src]
PB: KeyParts,
RB: KeyRole,
Compares the public bits of two keys.
This returns Ordering::Equal if the public MPIs,
creation time and algorithm of the two Key4
s match. This
does not consider the packet's encoding, packet's tag or the
secret key material.
pub fn public_eq<PB, RB>(&self, b: &Key4<PB, RB>) -> bool where
PB: KeyParts,
RB: KeyRole,
[src]
PB: KeyParts,
RB: KeyRole,
This method tests for self and other values to be equal modulo the secret bits.
This returns true if the public MPIs, creation time and
algorithm of the two Key4
s match. This does not consider
the packet's encoding, packet's tag or the secret key
material.
pub fn creation_time(&self) -> SystemTime
[src]
Gets the key packet's creation time field.
pub fn set_creation_time<T>(&mut self, timestamp: T) -> Result<SystemTime> where
T: Into<SystemTime>,
[src]
T: Into<SystemTime>,
Sets the key packet's creation time field.
pub fn pk_algo(&self) -> PublicKeyAlgorithm
[src]
Gets the public key algorithm.
pub fn set_pk_algo(&mut self, pk_algo: PublicKeyAlgorithm) -> PublicKeyAlgorithm
[src]
Sets the public key algorithm.
pub fn mpis(&self) -> &PublicKey
[src]
Gets the key packet's MPIs.
pub fn mpis_mut(&mut self) -> &mut PublicKey
[src]
Gets a mutable reference to the key packet's MPIs.
pub fn set_mpis(&mut self, mpis: PublicKey) -> PublicKey
[src]
Sets the key packet's MPIs.
pub fn has_secret(&self) -> bool
[src]
Returns whether the key contains secret key material.
pub fn has_unencrypted_secret(&self) -> bool
[src]
Returns whether the key contains unencrypted secret key material.
pub fn optional_secret(&self) -> Option<&SecretKeyMaterial>
[src]
Gets the key packet's SecretKeyMaterial
, if any.
pub fn key_handle(&self) -> KeyHandle
[src]
Computes and returns the key's fingerprint as per Section 12.2 of RFC 4880 as returns it as a KeyHandle.
pub fn fingerprint(&self) -> Fingerprint
[src]
Computes and returns the key's fingerprint as per Section 12.2 of RFC 4880.
pub fn keyid(&self) -> KeyID
[src]
Computes and returns the key's key ID as per Section 12.2 of RFC 4880.
pub fn secret(&self) -> &SecretKeyMaterial
[src]
Gets the key packet's SecretKeyMaterial
.
pub fn secret_mut(&mut self) -> &mut SecretKeyMaterial
[src]
Gets a mutable reference to the key packet's
SecretKeyMaterial
.
Trait Implementations
impl<P, R> Arbitrary for Key<P, R> where
P: KeyParts,
P: Clone,
R: KeyRole,
R: Clone,
Key4<P, R>: Arbitrary,
[src]
P: KeyParts,
P: Clone,
R: KeyRole,
R: Clone,
Key4<P, R>: Arbitrary,
fn arbitrary<G: Gen>(g: &mut G) -> Self
[src]
fn shrink(&self) -> Box<dyn Iterator<Item = Self> + 'static>
[src]
impl<P: Clone + KeyParts, R: Clone + KeyRole> Clone for Key<P, R>
[src]
impl<P: Debug + KeyParts, R: Debug + KeyRole> Debug for Key<P, R>
[src]
impl<P: KeyParts, R: KeyRole> Deref for Key<P, R>
[src]
type Target = Key4<P, R>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<P: KeyParts, R: KeyRole> DerefMut for Key<P, R>
[src]
impl<P: KeyParts, R: KeyRole> Display for Key<P, R>
[src]
impl<P: Eq + KeyParts, R: Eq + KeyRole> Eq for Key<P, R>
[src]
impl<'_, '_, P> From<&'_ Key<P, PrimaryRole>> for &'_ Key<P, SubordinateRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: &Key<P, PrimaryRole>) -> Self
[src]
impl<'_, '_, P> From<&'_ Key<P, PrimaryRole>> for &'_ Key<P, UnspecifiedRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: &Key<P, PrimaryRole>) -> Self
[src]
impl<'_, '_, P> From<&'_ Key<P, SubordinateRole>> for &'_ Key<P, PrimaryRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: &Key<P, SubordinateRole>) -> Self
[src]
impl<'_, '_, P> From<&'_ Key<P, SubordinateRole>> for &'_ Key<P, UnspecifiedRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: &Key<P, SubordinateRole>) -> Self
[src]
impl<'_, '_, P> From<&'_ Key<P, UnspecifiedRole>> for &'_ Key<P, PrimaryRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: &Key<P, UnspecifiedRole>) -> Self
[src]
impl<'_, '_, P> From<&'_ Key<P, UnspecifiedRole>> for &'_ Key<P, SubordinateRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: &Key<P, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, PrimaryRole>> for &'_ Key<SecretParts, SubordinateRole>
[src]
fn from(p: &Key<PublicParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, PrimaryRole>> for &'_ Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: &Key<PublicParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, PrimaryRole>> for &'_ Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: &Key<PublicParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, PrimaryRole>> for &'_ Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: &Key<PublicParts, PrimaryRole>) -> Self
[src]
impl<'_, '_, R> From<&'_ Key<PublicParts, R>> for &'_ Key<UnspecifiedParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: &Key<PublicParts, R>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, SubordinateRole>> for &'_ Key<SecretParts, PrimaryRole>
[src]
fn from(p: &Key<PublicParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, SubordinateRole>> for &'_ Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: &Key<PublicParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, SubordinateRole>> for &'_ Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: &Key<PublicParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, SubordinateRole>> for &'_ Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: &Key<PublicParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, UnspecifiedRole>> for &'_ Key<SecretParts, PrimaryRole>
[src]
fn from(p: &Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, UnspecifiedRole>> for &'_ Key<SecretParts, SubordinateRole>
[src]
fn from(p: &Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, UnspecifiedRole>> for &'_ Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: &Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<PublicParts, UnspecifiedRole>> for &'_ Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: &Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, PrimaryRole>> for &'_ Key<PublicParts, SubordinateRole>
[src]
fn from(p: &Key<SecretParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, PrimaryRole>> for &'_ Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: &Key<SecretParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, PrimaryRole>> for &'_ Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: &Key<SecretParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, PrimaryRole>> for &'_ Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: &Key<SecretParts, PrimaryRole>) -> Self
[src]
impl<'_, '_, R> From<&'_ Key<SecretParts, R>> for &'_ Key<PublicParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: &Key<SecretParts, R>) -> Self
[src]
impl<'_, '_, R> From<&'_ Key<SecretParts, R>> for &'_ Key<UnspecifiedParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: &Key<SecretParts, R>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, SubordinateRole>> for &'_ Key<PublicParts, PrimaryRole>
[src]
fn from(p: &Key<SecretParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, SubordinateRole>> for &'_ Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: &Key<SecretParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, SubordinateRole>> for &'_ Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: &Key<SecretParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, SubordinateRole>> for &'_ Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: &Key<SecretParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, UnspecifiedRole>> for &'_ Key<PublicParts, PrimaryRole>
[src]
fn from(p: &Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, UnspecifiedRole>> for &'_ Key<PublicParts, SubordinateRole>
[src]
fn from(p: &Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, UnspecifiedRole>> for &'_ Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: &Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<SecretParts, UnspecifiedRole>> for &'_ Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: &Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, PrimaryRole>> for &'_ Key<PublicParts, SubordinateRole>
[src]
fn from(p: &Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, PrimaryRole>> for &'_ Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: &Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, PrimaryRole>> for &'_ Key<SecretParts, SubordinateRole>
[src]
fn from(p: &Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, PrimaryRole>> for &'_ Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: &Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl<'_, '_, R> From<&'_ Key<UnspecifiedParts, R>> for &'_ Key<PublicParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: &Key<UnspecifiedParts, R>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, SubordinateRole>> for &'_ Key<PublicParts, PrimaryRole>
[src]
fn from(p: &Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, SubordinateRole>> for &'_ Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: &Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, SubordinateRole>> for &'_ Key<SecretParts, PrimaryRole>
[src]
fn from(p: &Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, SubordinateRole>> for &'_ Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: &Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, UnspecifiedRole>> for &'_ Key<PublicParts, PrimaryRole>
[src]
fn from(p: &Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, UnspecifiedRole>> for &'_ Key<PublicParts, SubordinateRole>
[src]
fn from(p: &Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, UnspecifiedRole>> for &'_ Key<SecretParts, PrimaryRole>
[src]
fn from(p: &Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl<'_, '_> From<&'_ Key<UnspecifiedParts, UnspecifiedRole>> for &'_ Key<SecretParts, SubordinateRole>
[src]
fn from(p: &Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl<'a> From<&'a Key<PublicParts, UnspecifiedRole>> for Recipient<'a>
[src]
fn from(key: &'a Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl<P> From<Key<P, PrimaryRole>> for Key<P, SubordinateRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: Key<P, PrimaryRole>) -> Self
[src]
impl<P> From<Key<P, PrimaryRole>> for Key<P, UnspecifiedRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: Key<P, PrimaryRole>) -> Self
[src]
impl<P> From<Key<P, SubordinateRole>> for Key<P, PrimaryRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: Key<P, SubordinateRole>) -> Self
[src]
impl<P> From<Key<P, SubordinateRole>> for Key<P, UnspecifiedRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: Key<P, SubordinateRole>) -> Self
[src]
impl<P> From<Key<P, UnspecifiedRole>> for Key<P, PrimaryRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: Key<P, UnspecifiedRole>) -> Self
[src]
impl<P> From<Key<P, UnspecifiedRole>> for Key<P, SubordinateRole> where
P: KeyParts,
[src]
P: KeyParts,
fn from(p: Key<P, UnspecifiedRole>) -> Self
[src]
impl From<Key<PublicParts, PrimaryRole>> for Key<SecretParts, SubordinateRole>
[src]
fn from(p: Key<PublicParts, PrimaryRole>) -> Self
[src]
impl From<Key<PublicParts, PrimaryRole>> for Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: Key<PublicParts, PrimaryRole>) -> Self
[src]
impl From<Key<PublicParts, PrimaryRole>> for Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: Key<PublicParts, PrimaryRole>) -> Self
[src]
impl From<Key<PublicParts, PrimaryRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: Key<PublicParts, PrimaryRole>) -> Self
[src]
impl From<Key<PublicParts, PrimaryRole>> for Packet
[src]
fn from(k: Key<PublicParts, PrimaryRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl<R> From<Key<PublicParts, R>> for Key<UnspecifiedParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: Key<PublicParts, R>) -> Self
[src]
impl From<Key<PublicParts, SubordinateRole>> for Key<SecretParts, PrimaryRole>
[src]
fn from(p: Key<PublicParts, SubordinateRole>) -> Self
[src]
impl From<Key<PublicParts, SubordinateRole>> for Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: Key<PublicParts, SubordinateRole>) -> Self
[src]
impl From<Key<PublicParts, SubordinateRole>> for Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: Key<PublicParts, SubordinateRole>) -> Self
[src]
impl From<Key<PublicParts, SubordinateRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: Key<PublicParts, SubordinateRole>) -> Self
[src]
impl From<Key<PublicParts, SubordinateRole>> for Packet
[src]
fn from(k: Key<PublicParts, SubordinateRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<PublicParts, UnspecifiedRole>> for Key<SecretParts, PrimaryRole>
[src]
fn from(p: Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<PublicParts, UnspecifiedRole>> for Key<SecretParts, SubordinateRole>
[src]
fn from(p: Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<PublicParts, UnspecifiedRole>> for Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<PublicParts, UnspecifiedRole>> for Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: Key<PublicParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<SecretParts, PrimaryRole>> for Key<PublicParts, SubordinateRole>
[src]
fn from(p: Key<SecretParts, PrimaryRole>) -> Self
[src]
impl From<Key<SecretParts, PrimaryRole>> for Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: Key<SecretParts, PrimaryRole>) -> Self
[src]
impl From<Key<SecretParts, PrimaryRole>> for Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: Key<SecretParts, PrimaryRole>) -> Self
[src]
impl From<Key<SecretParts, PrimaryRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: Key<SecretParts, PrimaryRole>) -> Self
[src]
impl From<Key<SecretParts, PrimaryRole>> for Packet
[src]
fn from(k: Key<SecretParts, PrimaryRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl<R> From<Key<SecretParts, R>> for Key<PublicParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: Key<SecretParts, R>) -> Self
[src]
impl<R> From<Key<SecretParts, R>> for Key<UnspecifiedParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: Key<SecretParts, R>) -> Self
[src]
impl From<Key<SecretParts, SubordinateRole>> for Key<PublicParts, PrimaryRole>
[src]
fn from(p: Key<SecretParts, SubordinateRole>) -> Self
[src]
impl From<Key<SecretParts, SubordinateRole>> for Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: Key<SecretParts, SubordinateRole>) -> Self
[src]
impl From<Key<SecretParts, SubordinateRole>> for Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: Key<SecretParts, SubordinateRole>) -> Self
[src]
impl From<Key<SecretParts, SubordinateRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from(p: Key<SecretParts, SubordinateRole>) -> Self
[src]
impl From<Key<SecretParts, SubordinateRole>> for Packet
[src]
fn from(k: Key<SecretParts, SubordinateRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<SecretParts, UnspecifiedRole>> for Key<PublicParts, PrimaryRole>
[src]
fn from(p: Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<SecretParts, UnspecifiedRole>> for Key<PublicParts, SubordinateRole>
[src]
fn from(p: Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<SecretParts, UnspecifiedRole>> for Key<UnspecifiedParts, PrimaryRole>
[src]
fn from(p: Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<SecretParts, UnspecifiedRole>> for Key<UnspecifiedParts, SubordinateRole>
[src]
fn from(p: Key<SecretParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, PrimaryRole>> for Key<PublicParts, SubordinateRole>
[src]
fn from(p: Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, PrimaryRole>> for Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, PrimaryRole>> for Key<SecretParts, SubordinateRole>
[src]
fn from(p: Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, PrimaryRole>> for Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: Key<UnspecifiedParts, PrimaryRole>) -> Self
[src]
impl<R> From<Key<UnspecifiedParts, R>> for Key<PublicParts, R> where
R: KeyRole,
[src]
R: KeyRole,
fn from(p: Key<UnspecifiedParts, R>) -> Self
[src]
impl From<Key<UnspecifiedParts, SubordinateRole>> for Key<PublicParts, PrimaryRole>
[src]
fn from(p: Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, SubordinateRole>> for Key<PublicParts, UnspecifiedRole>
[src]
fn from(p: Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, SubordinateRole>> for Key<SecretParts, PrimaryRole>
[src]
fn from(p: Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, SubordinateRole>> for Key<SecretParts, UnspecifiedRole>
[src]
fn from(p: Key<UnspecifiedParts, SubordinateRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, UnspecifiedRole>> for Key<PublicParts, PrimaryRole>
[src]
fn from(p: Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, UnspecifiedRole>> for Key<PublicParts, SubordinateRole>
[src]
fn from(p: Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, UnspecifiedRole>> for Key<SecretParts, PrimaryRole>
[src]
fn from(p: Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl From<Key<UnspecifiedParts, UnspecifiedRole>> for Key<SecretParts, SubordinateRole>
[src]
fn from(p: Key<UnspecifiedParts, UnspecifiedRole>) -> Self
[src]
impl<P, R> From<Key4<P, R>> for Key<P, R> where
P: KeyParts,
R: KeyRole,
[src]
P: KeyParts,
R: KeyRole,
impl From<KeyPair> for Key<SecretParts, UnspecifiedRole>
[src]
impl<P: Hash + KeyParts, R: Hash + KeyRole> Hash for Key<P, R>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<P: KeyParts, R: KeyRole> Marshal for Key<P, R>
[src]
fn serialize(&self, o: &mut dyn Write) -> Result<()>
[src]
fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
impl<P: KeyParts, R: KeyRole> MarshalInto for Key<P, R>
[src]
fn serialized_len(&self) -> usize
[src]
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn export_to_vec(&self) -> Result<Vec<u8>>
[src]
impl<'a> Parse<'a, Key<UnspecifiedParts, UnspecifiedRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[src]
fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>
[src]
fn from_file<P: AsRef<Path>>(path: P) -> Result<T>
[src]
fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>
[src]
impl<P: PartialEq + KeyParts, R: PartialEq + KeyRole> PartialEq<Key<P, R>> for Key<P, R>
[src]
impl<P: KeyParts, R: KeyRole> StructuralEq for Key<P, R>
[src]
impl<P: KeyParts, R: KeyRole> StructuralPartialEq for Key<P, R>
[src]
impl<'_, '_, R> TryFrom<&'_ Key<PublicParts, R>> for &'_ Key<SecretParts, R> where
R: KeyRole,
[src]
R: KeyRole,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(p: &Key<PublicParts, R>) -> Result<Self>
[src]
impl<'_, '_, R> TryFrom<&'_ Key<UnspecifiedParts, R>> for &'_ Key<SecretParts, R> where
R: KeyRole,
[src]
R: KeyRole,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(p: &Key<UnspecifiedParts, R>) -> Result<Self>
[src]
impl<R> TryFrom<Key<PublicParts, R>> for Key<SecretParts, R> where
R: KeyRole,
[src]
R: KeyRole,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(p: Key<PublicParts, R>) -> Result<Self>
[src]
impl<R> TryFrom<Key<UnspecifiedParts, R>> for Key<SecretParts, R> where
R: KeyRole,
[src]
R: KeyRole,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(p: Key<UnspecifiedParts, R>) -> Result<Self>
[src]
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>,
fn cert(&self) -> &ValidCert<'a>
[src]
fn time(&self) -> SystemTime
[src]
fn policy(&self) -> &'a dyn Policy
[src]
fn binding_signature(&self) -> &'a Signature
[src]
fn direct_key_signature(&self) -> Result<&'a Signature>
[src]
fn revoked(&self) -> RevocationStatus<'a>
[src]
fn key_expiration_time(&self) -> Option<SystemTime>
[src]
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, P> ValidateAmalgamation<'a, Key<P, PrimaryRole>> for PrimaryKeyAmalgamation<'a, P> where
P: 'a + KeyParts,
[src]
P: 'a + KeyParts,
type V = ValidPrimaryKeyAmalgamation<'a, P>
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>>,
[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
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,
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>
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>>,
[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
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,
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>
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>>,
[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
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<P, R> RefUnwindSafe for Key<P, R> where
P: RefUnwindSafe,
R: RefUnwindSafe,
P: RefUnwindSafe,
R: RefUnwindSafe,
impl<P, R> Send for Key<P, R> where
P: Send,
R: Send,
P: Send,
R: Send,
impl<P, R> Sync for Key<P, R> where
P: Sync,
R: Sync,
P: Sync,
R: Sync,
impl<P, R> Unpin for Key<P, R> where
P: Unpin,
R: Unpin,
P: Unpin,
R: Unpin,
impl<P, R> UnwindSafe for Key<P, R> where
P: UnwindSafe,
R: UnwindSafe,
P: UnwindSafe,
R: UnwindSafe,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,