[−][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.
Variants
V4(Key4<P, R>)
Key packet version 4.
Methods
impl<P, R> Key<P, R> where
P: KeyParts,
R: KeyRole,
[src]
P: KeyParts,
R: KeyRole,
pub fn mark_parts_public(self) -> Key<PublicParts, R>
[src]
Changes the key's parts tag to PublicParts
.
pub fn mark_parts_public_ref(&self) -> &Key<PublicParts, R>
[src]
Changes the key's parts tag to PublicParts
.
pub fn mark_parts_secret(self) -> Result<Key<SecretParts, R>>
[src]
Changes the key's parts tag to SecretParts
.
pub fn mark_parts_secret_ref(&self) -> Result<&Key<SecretParts, R>>
[src]
Changes the key's parts tag to SecretParts
.
pub fn mark_parts_unspecified(self) -> Key<UnspecifiedParts, R>
[src]
Changes the key's parts tag to UnspecifiedParts
.
pub fn mark_parts_unspecified_ref(&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.
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<P: KeyParts> Key<P, SubordinateRole>
[src]
pub fn bind<T>(
&self,
signer: &mut dyn Signer,
cert: &Cert,
signature: Builder,
creation_time: T
) -> Result<Signature> where
T: Into<Option<SystemTime>>,
[src]
&self,
signer: &mut dyn Signer,
cert: &Cert,
signature: Builder,
creation_time: T
) -> Result<Signature> where
T: Into<Option<SystemTime>>,
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.
// Generate a Cert, and create a keypair from the primary key. let (cert, _) = CertBuilder::new().generate()?; let mut keypair = cert.primary().clone() .mark_parts_secret()?.into_keypair()?; // Let's add an encryption subkey. let flags = KeyFlags::default().set_storage_encryption(true); assert_eq!(cert.keys().alive().revoked(false) .key_flags(flags.clone()).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, None)?; // 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().alive().revoked(false) .key_flags(flags).count(), 1);
Methods from Deref<Target = Key4<P, R>>
pub fn mark_parts_public_ref(&self) -> &Key4<PublicParts, R>
[src]
Changes the key's parts tag to PublicParts
.
pub fn mark_parts_secret_ref(&self) -> Result<&Key4<SecretParts, R>>
[src]
Changes the key's parts tag to SecretParts
.
pub fn mark_parts_unspecified_ref(&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 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 secret(&self) -> Option<&SecretKeyMaterial>
[src]
Gets the key packet's SecretKeyMaterial
.
pub fn secret_mut(&mut self) -> Option<&mut SecretKeyMaterial>
[src]
Gets a mutable reference to the key packet's SecretKeyMaterial
.
pub fn set_secret(
&mut self,
secret: Option<SecretKeyMaterial>
) -> Option<SecretKeyMaterial>
[src]
&mut self,
secret: Option<SecretKeyMaterial>
) -> Option<SecretKeyMaterial>
Sets the key packet's SecretKeyMaterial
.
Returns the old value.
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.
Trait Implementations
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<'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> Serialize 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> SerializeInto 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<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,
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>,