Struct sequoia_openpgp::packet::key::Key4

source ·
pub struct Key4<P, R>
where P: KeyParts, R: KeyRole,
{ /* private fields */ }
Expand description

Holds a public key, public subkey, private key or private subkey packet.

Use Key4::generate_rsa or Key4::generate_ecc to create a new key.

Existing key material can be turned into an OpenPGP key using Key4::new, Key4::with_secret, Key4::import_public_cv25519, Key4::import_public_ed25519, Key4::import_public_rsa, Key4::import_secret_cv25519, Key4::import_secret_ed25519, and Key4::import_secret_rsa.

Whether you create a new key or import existing key material, you still need to create a binding signature, and, for signing keys, a back signature before integrating the key into a certificate.

Normally, you won’t directly use Key4, but Key, which is a relatively thin wrapper around Key4.

See Section 5.5 of RFC 4880 and the documentation for Key for more details.

Implementations§

source§

impl<R> Key4<SecretParts, R>
where R: KeyRole,

source

pub fn import_secret_rsa<T>( d: &[u8], p: &[u8], q: &[u8], ctime: T, ) -> Result<Self>
where T: Into<Option<SystemTime>>,

Creates a new OpenPGP public key packet for an existing RSA key.

The RSA key will use public exponent e and modulo n. The key will have it’s creation date set to ctime or the current time if None is given.

source

pub fn generate_rsa(bits: usize) -> Result<Self>

Generates a new RSA key with a public modulus of size bits.

source§

impl<P, R> Key4<P, R>
where P: KeyParts, R: KeyRole,

source

pub fn parts_into_public(self) -> Key4<PublicParts, R>

Changes the key’s parts tag to PublicParts.

source

pub fn parts_as_public(&self) -> &Key4<PublicParts, R>

Changes the key’s parts tag to PublicParts.

source

pub fn parts_as_public_mut(&mut self) -> &mut Key4<PublicParts, R>

Changes the key’s parts tag to PublicParts.

source

pub fn parts_into_secret(self) -> Result<Key4<SecretParts, R>>

Changes the key’s parts tag to SecretParts.

source

pub fn parts_as_secret(&self) -> Result<&Key4<SecretParts, R>>

Changes the key’s parts tag to SecretParts.

source

pub fn parts_as_secret_mut(&mut self) -> Result<&mut Key4<SecretParts, R>>

Changes the key’s parts tag to SecretParts.

source

pub fn parts_into_unspecified(self) -> Key4<UnspecifiedParts, R>

Changes the key’s parts tag to UnspecifiedParts.

source

pub fn parts_as_unspecified(&self) -> &Key4<UnspecifiedParts, R>

Changes the key’s parts tag to UnspecifiedParts.

source

pub fn parts_as_unspecified_mut(&mut self) -> &mut Key4<UnspecifiedParts, R>

Changes the key’s parts tag to UnspecifiedParts.

source§

impl<P, R> Key4<P, R>
where P: KeyParts, R: KeyRole,

source

pub fn role_into_primary(self) -> Key4<P, PrimaryRole>

Changes the key’s role tag to PrimaryRole.

source

pub fn role_as_primary(&self) -> &Key4<P, PrimaryRole>

Changes the key’s role tag to PrimaryRole.

source

pub fn role_as_primary_mut(&mut self) -> &mut Key4<P, PrimaryRole>

Changes the key’s role tag to PrimaryRole.

source

pub fn role_into_subordinate(self) -> Key4<P, SubordinateRole>

Changes the key’s role tag to SubordinateRole.

source

pub fn role_as_subordinate(&self) -> &Key4<P, SubordinateRole>

Changes the key’s role tag to SubordinateRole.

source

pub fn role_as_subordinate_mut(&mut self) -> &mut Key4<P, SubordinateRole>

Changes the key’s role tag to SubordinateRole.

source

pub fn role_into_unspecified(self) -> Key4<P, UnspecifiedRole>

Changes the key’s role tag to UnspecifiedRole.

source

pub fn role_as_unspecified(&self) -> &Key4<P, UnspecifiedRole>

Changes the key’s role tag to UnspecifiedRole.

source

pub fn role_as_unspecified_mut(&mut self) -> &mut Key4<P, UnspecifiedRole>

Changes the key’s role tag to UnspecifiedRole.

source§

impl<P, R> Key4<P, R>
where P: KeyParts, R: KeyRole,

source

pub fn hash_algo_security(&self) -> HashAlgoSecurity

The security requirements of the hash algorithm for self-signatures.

A cryptographic hash algorithm usually has three security properties: pre-image resistance, second pre-image resistance, and collision resistance. If an attacker can influence the signed data, then the hash algorithm needs to have both second pre-image resistance, and collision resistance. If not, second pre-image resistance is sufficient.

In general, an attacker may be able to influence third-party signatures. But direct key signatures, and binding signatures are only over data fully determined by signer. And, an attacker’s control over self signatures over User IDs is limited due to their structure.

These observations can be used to extend the life of a hash algorithm after its collision resistance has been partially compromised, but not completely broken. For more details, please refer to the documentation for HashAlgoSecurity.

source

pub fn public_cmp<PB, RB>(&self, b: &Key4<PB, RB>) -> Ordering
where 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 Key4s match. This does not consider the packets’ encodings, packets’ tags or their secret key material.

source

pub fn public_eq<PB, RB>(&self, b: &Key4<PB, RB>) -> bool
where PB: KeyParts, RB: KeyRole,

Tests whether two keys are equal modulo their secret key material.

This returns true if the public MPIs, creation time and algorithm of the two Key4s match. This does not consider the packets’ encodings, packets’ tags or their secret key material.

source

pub fn public_hash<H>(&self, state: &mut H)
where H: Hasher,

Hashes everything but any secret key material into state.

This is an alternate implementation of Hash, which never hashes the secret key material.

source§

impl<R> Key4<PublicParts, R>
where R: KeyRole,

source

pub fn new<T>( creation_time: T, pk_algo: PublicKeyAlgorithm, mpis: PublicKey, ) -> Result<Self>
where T: Into<SystemTime>,

Creates an OpenPGP public key from the specified key material.

source

pub fn import_public_cv25519<H, S, T>( public_key: &[u8], hash: H, sym: S, ctime: T, ) -> Result<Self>

Creates an OpenPGP public key packet from existing X25519 key material.

The ECDH key will use hash algorithm hash and symmetric algorithm sym. If one or both are None secure defaults will be used. The key will have its creation date set to ctime or the current time if None is given.

source

pub fn import_public_ed25519<T>(public_key: &[u8], ctime: T) -> Result<Self>
where T: Into<Option<SystemTime>>,

Creates an OpenPGP public key packet from existing Ed25519 key material.

The key will have its creation date set to ctime or the current time if None is given.

source

pub fn import_public_rsa<T>(e: &[u8], n: &[u8], ctime: T) -> Result<Self>
where T: Into<Option<SystemTime>>,

Creates an OpenPGP public key packet from existing RSA key material.

The RSA key will use the public exponent e and the modulo n. The key will have its creation date set to ctime or the current time if None is given.

source§

impl<R> Key4<SecretParts, R>
where R: KeyRole,

source

pub fn with_secret<T>( creation_time: T, pk_algo: PublicKeyAlgorithm, mpis: PublicKey, secret: SecretKeyMaterial, ) -> Result<Self>
where T: Into<SystemTime>,

Creates an OpenPGP key packet from the specified secret key material.

source

pub fn import_secret_cv25519<H, S, T>( private_key: &[u8], hash: H, sym: S, ctime: T, ) -> Result<Self>

Creates a new OpenPGP secret key packet for an existing X25519 key.

The ECDH key will use hash algorithm hash and symmetric algorithm sym. If one or both are None secure defaults will be used. The key will have it’s creation date set to ctime or the current time if None is given.

The given private_key is expected to be in the native X25519 representation, i.e. as opaque byte string of length 32. It is transformed into OpenPGP’s representation during import.

source

pub fn import_secret_ed25519<T>(private_key: &[u8], ctime: T) -> Result<Self>
where T: Into<Option<SystemTime>>,

Creates a new OpenPGP secret key packet for an existing Ed25519 key.

The key will have it’s creation date set to ctime or the current time if None is given.

source

pub fn generate_ecc(for_signing: bool, curve: Curve) -> Result<Self>

Generates a new ECC key over curve.

If for_signing is false a ECDH key, if it’s true either a EdDSA or ECDSA key is generated. Giving for_signing == true and curve == Cv25519 will produce an error. Likewise for_signing == false and curve == Ed25519 will produce an error.

source

pub fn generate_dsa(p_bits: usize) -> Result<Self>

Generates a new DSA key with a public modulus of size p_bits.

Note: In order to comply with FIPS 186-4, and to increase compatibility with implementations, you SHOULD only generate keys with moduli of size 2048 or 3072 bits.

source

pub fn generate_elgamal(p_bits: usize) -> Result<Self>

Generates a new ElGamal key with a public modulus of size p_bits.

Note: ElGamal is no longer well supported in cryptographic libraries and should be avoided.

source§

impl<P, R> Key4<P, R>
where P: KeyParts, R: KeyRole,

source

pub fn creation_time(&self) -> SystemTime

Gets the Key’s creation time.

source

pub fn set_creation_time<T>(&mut self, timestamp: T) -> Result<SystemTime>
where T: Into<SystemTime>,

Sets the Key’s creation time.

timestamp is converted to OpenPGP’s internal format, Timestamp: a 32-bit quantity containing the number of seconds since the Unix epoch.

timestamp is silently rounded to match the internal resolution. An error is returned if timestamp is out of range.

source

pub fn pk_algo(&self) -> PublicKeyAlgorithm

Gets the public key algorithm.

source

pub fn set_pk_algo(&mut self, pk_algo: PublicKeyAlgorithm) -> PublicKeyAlgorithm

Sets the public key algorithm.

Returns the old public key algorithm.

source

pub fn mpis(&self) -> &PublicKey

Returns a reference to the Key’s MPIs.

source

pub fn mpis_mut(&mut self) -> &mut PublicKey

Returns a mutable reference to the Key’s MPIs.

source

pub fn set_mpis(&mut self, mpis: PublicKey) -> PublicKey

Sets the Key’s MPIs.

This function returns the old MPIs, if any.

source

pub fn has_secret(&self) -> bool

Returns whether the Key contains secret key material.

source

pub fn has_unencrypted_secret(&self) -> bool

Returns whether the Key contains unencrypted secret key material.

This returns false if the Key doesn’t contain any secret key material.

source

pub fn optional_secret(&self) -> Option<&SecretKeyMaterial>

Returns Key’s secret key material, if any.

source

pub fn key_handle(&self) -> KeyHandle

Computes and returns the Key’s Fingerprint and returns it as a KeyHandle.

See Section 12.2 of RFC 4880.

source

pub fn fingerprint(&self) -> Fingerprint

Computes and returns the Key’s Fingerprint.

See Section 12.2 of RFC 4880.

source

pub fn keyid(&self) -> KeyID

Computes and returns the Key’s Key ID.

See Section 12.2 of RFC 4880.

source§

impl<R> Key4<PublicParts, R>
where R: KeyRole,

Secret key material handling.

source

pub fn take_secret(self) -> (Key4<PublicParts, R>, Option<SecretKeyMaterial>)

Takes the Key’s SecretKeyMaterial, if any.

source

pub fn add_secret( self, secret: SecretKeyMaterial, ) -> (Key4<SecretParts, R>, Option<SecretKeyMaterial>)

Adds the secret key material to the Key, returning the old secret key material, if any.

source

pub fn steal_secret(&mut self) -> Option<SecretKeyMaterial>

Takes the Key’s SecretKeyMaterial, if any.

source§

impl<R> Key4<UnspecifiedParts, R>
where R: KeyRole,

Secret key material handling.

source

pub fn take_secret(self) -> (Key4<PublicParts, R>, Option<SecretKeyMaterial>)

Takes the Key’s SecretKeyMaterial, if any.

source

pub fn add_secret( self, secret: SecretKeyMaterial, ) -> (Key4<SecretParts, R>, Option<SecretKeyMaterial>)

Adds the secret key material to the Key, returning the old secret key material, if any.

source

pub fn steal_secret(&mut self) -> Option<SecretKeyMaterial>

Takes the Key’s SecretKeyMaterial, if any.

source§

impl<R> Key4<SecretParts, R>
where R: KeyRole,

Secret key handling.

source

pub fn secret(&self) -> &SecretKeyMaterial

Gets the Key’s SecretKeyMaterial.

source

pub fn secret_mut(&mut self) -> &mut SecretKeyMaterial

Gets a mutable reference to the Key’s SecretKeyMaterial.

source

pub fn take_secret(self) -> (Key4<PublicParts, R>, SecretKeyMaterial)

Takes the Key’s SecretKeyMaterial.

source

pub fn add_secret( self, secret: SecretKeyMaterial, ) -> (Key4<SecretParts, R>, SecretKeyMaterial)

Adds SecretKeyMaterial to the Key.

This function returns the old secret key material, if any.

source

pub fn decrypt_secret(self, password: &Password) -> Result<Self>

Decrypts the secret key material using password.

In OpenPGP, secret key material can be protected with a password. The password is usually hardened using a KDF.

Refer to the documentation of Key::decrypt_secret for details.

This function returns an error if the secret key material is not encrypted or the password is incorrect.

source

pub fn encrypt_secret(self, password: &Password) -> Result<Key4<SecretParts, R>>

Encrypts the secret key material using password.

In OpenPGP, secret key material can be protected with a password. The password is usually hardened using a KDF.

Refer to the documentation of Key::encrypt_secret for details.

This returns an error if the secret key material is already encrypted.

source§

impl<R: KeyRole> Key4<SecretParts, R>

source

pub fn into_keypair(self) -> Result<KeyPair>

Creates a new key pair from a secret Key with an unencrypted secret key.

§Errors

Fails if the secret key is encrypted. You can use Key::decrypt_secret to decrypt a key.

Trait Implementations§

source§

impl<P, R> Clone for Key4<P, R>
where P: KeyParts, R: KeyRole,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<P, R> Debug for Key4<P, R>
where P: KeyParts, R: KeyRole,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<P, R> Display for Key4<P, R>
where P: KeyParts, R: KeyRole,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<P> From<&Key4<P, PrimaryRole>> for &Key4<P, SubordinateRole>
where P: KeyParts,

source§

fn from(p: &Key4<P, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&Key4<P, PrimaryRole>> for &Key4<P, UnspecifiedRole>
where P: KeyParts,

source§

fn from(p: &Key4<P, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&Key4<P, SubordinateRole>> for &Key4<P, PrimaryRole>
where P: KeyParts,

source§

fn from(p: &Key4<P, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&Key4<P, SubordinateRole>> for &Key4<P, UnspecifiedRole>
where P: KeyParts,

source§

fn from(p: &Key4<P, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&Key4<P, UnspecifiedRole>> for &Key4<P, PrimaryRole>
where P: KeyParts,

source§

fn from(p: &Key4<P, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&Key4<P, UnspecifiedRole>> for &Key4<P, SubordinateRole>
where P: KeyParts,

source§

fn from(p: &Key4<P, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<PublicParts, PrimaryRole>> for &Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &Key4<PublicParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<PublicParts, PrimaryRole>> for &Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &Key4<PublicParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&Key4<PublicParts, R>> for &Key4<UnspecifiedParts, R>
where R: KeyRole,

source§

fn from(p: &Key4<PublicParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<PublicParts, SubordinateRole>> for &Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &Key4<PublicParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<PublicParts, SubordinateRole>> for &Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &Key4<PublicParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<PublicParts, UnspecifiedRole>> for &Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &Key4<PublicParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<PublicParts, UnspecifiedRole>> for &Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &Key4<PublicParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, PrimaryRole>> for &Key4<PublicParts, SubordinateRole>

source§

fn from(p: &Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, PrimaryRole>> for &Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, PrimaryRole>> for &Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, PrimaryRole>> for &Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&Key4<SecretParts, R>> for &Key4<PublicParts, R>
where R: KeyRole,

source§

fn from(p: &Key4<SecretParts, R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&Key4<SecretParts, R>> for &Key4<UnspecifiedParts, R>
where R: KeyRole,

source§

fn from(p: &Key4<SecretParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, SubordinateRole>> for &Key4<PublicParts, PrimaryRole>

source§

fn from(p: &Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, SubordinateRole>> for &Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, SubordinateRole>> for &Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, SubordinateRole>> for &Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, UnspecifiedRole>> for &Key4<PublicParts, PrimaryRole>

source§

fn from(p: &Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, UnspecifiedRole>> for &Key4<PublicParts, SubordinateRole>

source§

fn from(p: &Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, UnspecifiedRole>> for &Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<SecretParts, UnspecifiedRole>> for &Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<UnspecifiedParts, PrimaryRole>> for &Key4<PublicParts, SubordinateRole>

source§

fn from(p: &Key4<UnspecifiedParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<UnspecifiedParts, PrimaryRole>> for &Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &Key4<UnspecifiedParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&Key4<UnspecifiedParts, R>> for &Key4<PublicParts, R>
where R: KeyRole,

source§

fn from(p: &Key4<UnspecifiedParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<UnspecifiedParts, SubordinateRole>> for &Key4<PublicParts, PrimaryRole>

source§

fn from(p: &Key4<UnspecifiedParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<UnspecifiedParts, SubordinateRole>> for &Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &Key4<UnspecifiedParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<UnspecifiedParts, UnspecifiedRole>> for &Key4<PublicParts, PrimaryRole>

source§

fn from(p: &Key4<UnspecifiedParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&Key4<UnspecifiedParts, UnspecifiedRole>> for &Key4<PublicParts, SubordinateRole>

source§

fn from(p: &Key4<UnspecifiedParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&mut Key4<P, PrimaryRole>> for &mut Key4<P, SubordinateRole>
where P: KeyParts,

source§

fn from(p: &mut Key4<P, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&mut Key4<P, PrimaryRole>> for &mut Key4<P, UnspecifiedRole>
where P: KeyParts,

source§

fn from(p: &mut Key4<P, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&mut Key4<P, SubordinateRole>> for &mut Key4<P, PrimaryRole>
where P: KeyParts,

source§

fn from(p: &mut Key4<P, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&mut Key4<P, SubordinateRole>> for &mut Key4<P, UnspecifiedRole>
where P: KeyParts,

source§

fn from(p: &mut Key4<P, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&mut Key4<P, UnspecifiedRole>> for &mut Key4<P, PrimaryRole>
where P: KeyParts,

source§

fn from(p: &mut Key4<P, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<&mut Key4<P, UnspecifiedRole>> for &mut Key4<P, SubordinateRole>
where P: KeyParts,

source§

fn from(p: &mut Key4<P, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<PublicParts, PrimaryRole>> for &mut Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &mut Key4<PublicParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<PublicParts, PrimaryRole>> for &mut Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<PublicParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&mut Key4<PublicParts, R>> for &mut Key4<UnspecifiedParts, R>
where R: KeyRole,

source§

fn from(p: &mut Key4<PublicParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<PublicParts, SubordinateRole>> for &mut Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &mut Key4<PublicParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<PublicParts, SubordinateRole>> for &mut Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<PublicParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<PublicParts, UnspecifiedRole>> for &mut Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &mut Key4<PublicParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<PublicParts, UnspecifiedRole>> for &mut Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &mut Key4<PublicParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, PrimaryRole>> for &mut Key4<PublicParts, SubordinateRole>

source§

fn from(p: &mut Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, PrimaryRole>> for &mut Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, PrimaryRole>> for &mut Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &mut Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, PrimaryRole>> for &mut Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&mut Key4<SecretParts, R>> for &mut Key4<PublicParts, R>
where R: KeyRole,

source§

fn from(p: &mut Key4<SecretParts, R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&mut Key4<SecretParts, R>> for &mut Key4<UnspecifiedParts, R>
where R: KeyRole,

source§

fn from(p: &mut Key4<SecretParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, SubordinateRole>> for &mut Key4<PublicParts, PrimaryRole>

source§

fn from(p: &mut Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, SubordinateRole>> for &mut Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, SubordinateRole>> for &mut Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &mut Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, SubordinateRole>> for &mut Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, UnspecifiedRole>> for &mut Key4<PublicParts, PrimaryRole>

source§

fn from(p: &mut Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, UnspecifiedRole>> for &mut Key4<PublicParts, SubordinateRole>

source§

fn from(p: &mut Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, UnspecifiedRole>> for &mut Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: &mut Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<SecretParts, UnspecifiedRole>> for &mut Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: &mut Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<UnspecifiedParts, PrimaryRole>> for &mut Key4<PublicParts, SubordinateRole>

source§

fn from(p: &mut Key4<UnspecifiedParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<UnspecifiedParts, PrimaryRole>> for &mut Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<UnspecifiedParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<&mut Key4<UnspecifiedParts, R>> for &mut Key4<PublicParts, R>
where R: KeyRole,

source§

fn from(p: &mut Key4<UnspecifiedParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<UnspecifiedParts, SubordinateRole>> for &mut Key4<PublicParts, PrimaryRole>

source§

fn from(p: &mut Key4<UnspecifiedParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<UnspecifiedParts, SubordinateRole>> for &mut Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: &mut Key4<UnspecifiedParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<UnspecifiedParts, UnspecifiedRole>> for &mut Key4<PublicParts, PrimaryRole>

source§

fn from(p: &mut Key4<UnspecifiedParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<&mut Key4<UnspecifiedParts, UnspecifiedRole>> for &mut Key4<PublicParts, SubordinateRole>

source§

fn from(p: &mut Key4<UnspecifiedParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<Key4<P, PrimaryRole>> for Key4<P, SubordinateRole>
where P: KeyParts,

source§

fn from(p: Key4<P, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<Key4<P, PrimaryRole>> for Key4<P, UnspecifiedRole>
where P: KeyParts,

source§

fn from(p: Key4<P, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<P, R> From<Key4<P, R>> for Key<P, R>
where P: KeyParts, R: KeyRole,

source§

fn from(p: Key4<P, R>) -> Self

Converts to this type from the input type.
source§

impl<P> From<Key4<P, SubordinateRole>> for Key4<P, PrimaryRole>
where P: KeyParts,

source§

fn from(p: Key4<P, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<Key4<P, SubordinateRole>> for Key4<P, UnspecifiedRole>
where P: KeyParts,

source§

fn from(p: Key4<P, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<Key4<P, UnspecifiedRole>> for Key4<P, PrimaryRole>
where P: KeyParts,

source§

fn from(p: Key4<P, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl<P> From<Key4<P, UnspecifiedRole>> for Key4<P, SubordinateRole>
where P: KeyParts,

source§

fn from(p: Key4<P, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<PublicParts, PrimaryRole>> for Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: Key4<PublicParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<PublicParts, PrimaryRole>> for Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: Key4<PublicParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<Key4<PublicParts, R>> for Key4<UnspecifiedParts, R>
where R: KeyRole,

source§

fn from(p: Key4<PublicParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<PublicParts, SubordinateRole>> for Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: Key4<PublicParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<PublicParts, SubordinateRole>> for Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: Key4<PublicParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<PublicParts, UnspecifiedRole>> for Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: Key4<PublicParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<PublicParts, UnspecifiedRole>> for Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: Key4<PublicParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, PrimaryRole>> for Key4<PublicParts, SubordinateRole>

source§

fn from(p: Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, PrimaryRole>> for Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, PrimaryRole>> for Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, PrimaryRole>> for Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: Key4<SecretParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<Key4<SecretParts, R>> for Key4<PublicParts, R>
where R: KeyRole,

source§

fn from(p: Key4<SecretParts, R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<Key4<SecretParts, R>> for Key4<UnspecifiedParts, R>
where R: KeyRole,

source§

fn from(p: Key4<SecretParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, SubordinateRole>> for Key4<PublicParts, PrimaryRole>

source§

fn from(p: Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, SubordinateRole>> for Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, SubordinateRole>> for Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, SubordinateRole>> for Key4<UnspecifiedParts, UnspecifiedRole>

source§

fn from(p: Key4<SecretParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, UnspecifiedRole>> for Key4<PublicParts, PrimaryRole>

source§

fn from(p: Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, UnspecifiedRole>> for Key4<PublicParts, SubordinateRole>

source§

fn from(p: Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, UnspecifiedRole>> for Key4<UnspecifiedParts, PrimaryRole>

source§

fn from(p: Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<SecretParts, UnspecifiedRole>> for Key4<UnspecifiedParts, SubordinateRole>

source§

fn from(p: Key4<SecretParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<UnspecifiedParts, PrimaryRole>> for Key4<PublicParts, SubordinateRole>

source§

fn from(p: Key4<UnspecifiedParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<UnspecifiedParts, PrimaryRole>> for Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: Key4<UnspecifiedParts, PrimaryRole>) -> Self

Converts to this type from the input type.
source§

impl<R> From<Key4<UnspecifiedParts, R>> for Key4<PublicParts, R>
where R: KeyRole,

source§

fn from(p: Key4<UnspecifiedParts, R>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<UnspecifiedParts, SubordinateRole>> for Key4<PublicParts, PrimaryRole>

source§

fn from(p: Key4<UnspecifiedParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<UnspecifiedParts, SubordinateRole>> for Key4<PublicParts, UnspecifiedRole>

source§

fn from(p: Key4<UnspecifiedParts, SubordinateRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<UnspecifiedParts, UnspecifiedRole>> for Key4<PublicParts, PrimaryRole>

source§

fn from(p: Key4<UnspecifiedParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl From<Key4<UnspecifiedParts, UnspecifiedRole>> for Key4<PublicParts, SubordinateRole>

source§

fn from(p: Key4<UnspecifiedParts, UnspecifiedRole>) -> Self

Converts to this type from the input type.
source§

impl<P, R> Hash for Key4<P, R>
where P: KeyParts, R: KeyRole,

source§

fn hash(&self, hash: &mut dyn Digest)

Updates the given hash with this object.
source§

impl<P: KeyParts, R: KeyRole> Hash for Key4<P, R>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<P, R> Marshal for Key4<P, R>
where P: KeyParts, R: KeyRole,

source§

fn serialize(&self, o: &mut dyn Write) -> Result<()>

Writes a serialized version of the object to o.
source§

fn export(&self, o: &mut dyn Write) -> Result<()>

Exports a serialized version of the object to o. Read more
source§

impl<P, R> MarshalInto for Key4<P, R>
where P: KeyParts, R: KeyRole,

source§

fn serialized_len(&self) -> usize

Computes the maximal length of the serialized representation. Read more
source§

fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>

Serializes into the given buffer. Read more
source§

fn to_vec(&self) -> Result<Vec<u8>>

Serializes the packet to a vector.
source§

fn export_into(&self, buf: &mut [u8]) -> Result<usize>

Exports into the given buffer. Read more
source§

fn export_to_vec(&self) -> Result<Vec<u8>>

Exports to a vector. Read more
source§

impl<P: KeyParts, R: KeyRole> PartialEq for Key4<P, R>

source§

fn eq(&self, other: &Key4<P, R>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&Key4<PublicParts, PrimaryRole>> for &Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<PublicParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<PublicParts, PrimaryRole>> for &Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<PublicParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl<R> TryFrom<&Key4<PublicParts, R>> for &Key4<SecretParts, R>
where R: KeyRole,

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<PublicParts, R>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<PublicParts, SubordinateRole>> for &Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<PublicParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<PublicParts, SubordinateRole>> for &Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<PublicParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<PublicParts, UnspecifiedRole>> for &Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<PublicParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<PublicParts, UnspecifiedRole>> for &Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<PublicParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<UnspecifiedParts, PrimaryRole>> for &Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<UnspecifiedParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<UnspecifiedParts, PrimaryRole>> for &Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<UnspecifiedParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl<R> TryFrom<&Key4<UnspecifiedParts, R>> for &Key4<SecretParts, R>
where R: KeyRole,

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<UnspecifiedParts, R>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<UnspecifiedParts, SubordinateRole>> for &Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<UnspecifiedParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<UnspecifiedParts, SubordinateRole>> for &Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<UnspecifiedParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<UnspecifiedParts, UnspecifiedRole>> for &Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<UnspecifiedParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Key4<UnspecifiedParts, UnspecifiedRole>> for &Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &Key4<UnspecifiedParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<PublicParts, PrimaryRole>> for &mut Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<PublicParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<PublicParts, PrimaryRole>> for &mut Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<PublicParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl<R> TryFrom<&mut Key4<PublicParts, R>> for &mut Key4<SecretParts, R>
where R: KeyRole,

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<PublicParts, R>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<PublicParts, SubordinateRole>> for &mut Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<PublicParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<PublicParts, SubordinateRole>> for &mut Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<PublicParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<PublicParts, UnspecifiedRole>> for &mut Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<PublicParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<PublicParts, UnspecifiedRole>> for &mut Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<PublicParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<UnspecifiedParts, PrimaryRole>> for &mut Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<UnspecifiedParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<UnspecifiedParts, PrimaryRole>> for &mut Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<UnspecifiedParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl<R> TryFrom<&mut Key4<UnspecifiedParts, R>> for &mut Key4<SecretParts, R>
where R: KeyRole,

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<UnspecifiedParts, R>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<UnspecifiedParts, SubordinateRole>> for &mut Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<UnspecifiedParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<UnspecifiedParts, SubordinateRole>> for &mut Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<UnspecifiedParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<UnspecifiedParts, UnspecifiedRole>> for &mut Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<UnspecifiedParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&mut Key4<UnspecifiedParts, UnspecifiedRole>> for &mut Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: &mut Key4<UnspecifiedParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<PublicParts, PrimaryRole>> for Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<PublicParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<PublicParts, PrimaryRole>> for Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<PublicParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl<R> TryFrom<Key4<PublicParts, R>> for Key4<SecretParts, R>
where R: KeyRole,

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<PublicParts, R>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<PublicParts, SubordinateRole>> for Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<PublicParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<PublicParts, SubordinateRole>> for Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<PublicParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<PublicParts, UnspecifiedRole>> for Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<PublicParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<PublicParts, UnspecifiedRole>> for Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<PublicParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<UnspecifiedParts, PrimaryRole>> for Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<UnspecifiedParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<UnspecifiedParts, PrimaryRole>> for Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<UnspecifiedParts, PrimaryRole>) -> Result<Self>

Performs the conversion.
source§

impl<R> TryFrom<Key4<UnspecifiedParts, R>> for Key4<SecretParts, R>
where R: KeyRole,

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<UnspecifiedParts, R>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<UnspecifiedParts, SubordinateRole>> for Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<UnspecifiedParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<UnspecifiedParts, SubordinateRole>> for Key4<SecretParts, UnspecifiedRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<UnspecifiedParts, SubordinateRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<UnspecifiedParts, UnspecifiedRole>> for Key4<SecretParts, PrimaryRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<UnspecifiedParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Key4<UnspecifiedParts, UnspecifiedRole>> for Key4<SecretParts, SubordinateRole>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Key4<UnspecifiedParts, UnspecifiedRole>) -> Result<Self>

Performs the conversion.
source§

impl<P: KeyParts, R: KeyRole> Eq for Key4<P, R>

Auto Trait Implementations§

§

impl<P, R> !Freeze for Key4<P, R>

§

impl<P, R> RefUnwindSafe for Key4<P, R>

§

impl<P, R> Send for Key4<P, R>
where P: Send, R: Send,

§

impl<P, R> Sync for Key4<P, R>
where P: Sync, R: Sync,

§

impl<P, R> Unpin for Key4<P, R>
where P: Unpin, R: Unpin,

§

impl<P, R> UnwindSafe for Key4<P, R>
where P: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T