Enum sequoia_openpgp::packet::Key

source ·
#[non_exhaustive]
pub enum Key<P: KeyParts, R: KeyRole> { V4(Key4<P, R>), }
Expand description

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

The different Key packets are described in Section 5.5 of RFC 4880.

Note: This enum cannot be exhaustively matched to allow future extensions.

§Key Variants

There are four different types of keys in OpenPGP: public keys, secret keys, public subkeys, and secret subkeys. Although the semantics of each type of key are slightly different, the underlying representation is identical (even a public key and a secret key are the same: the public key variant just contains 0 bits of secret key material).

In Sequoia, we use a single type, Key, for all four variants. To improve type safety, we use marker traits rather than an enum to distinguish them. Specifically, we Key is generic over two type variables, P and R.

P and R take marker traits, which describe how any secret key material should be treated, and the key’s role (primary or subordinate). The markers also determine the Key’s behavior and the exposed functionality. P can be key::PublicParts, key::SecretParts, or key::UnspecifiedParts. And, R can be key::PrimaryRole, key::SubordinateRole, or key::UnspecifiedRole.

If P is key::PublicParts, any secret key material that is present is ignored. For instance, when serializing a key with this marker, any secret key material will be skipped. This is illutrated in the following example. If P is key::SecretParts, then the key definitely contains secret key material (although it is not guaranteed that the secret key material is valid), and methods that require secret key material are available.

Unlike P, R does not say anything about the Key’s content. But, a key’s role does influence’s the key’s semantics. For instance, some of a primary key’s meta-data is located on the primary User ID whereas a subordinate key’s meta-data is located on its binding signature.

The unspecified variants key::UnspecifiedParts and key::UnspecifiedRole exist to simplify type erasure, which is needed to mix different types of keys in a single collection. For instance, Cert::keys returns an iterator over the keys in a certificate. Since the keys have different roles (a primary key and zero or more subkeys), but the Iterator has to be over a single, fixed type, the returned keys use the key::UnspecifiedRole marker.

§Examples

Serializing a public key with secret key material drops the secret key material:

use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::packet::prelude::*;
use sequoia_openpgp::parse::Parse;
use openpgp::serialize::Serialize;

// Generate a new certificate.  It has secret key material.
let (cert, _) = CertBuilder::new()
    .generate()?;

let pk = cert.primary_key().key();
assert!(pk.has_secret());

// Serializing a `Key<key::PublicParts, _>` drops the secret key
// material.
let mut bytes = Vec::new();
Packet::from(pk.clone()).serialize(&mut bytes);
let p : Packet = Packet::from_bytes(&bytes)?;

if let Packet::PublicKey(key) = p {
    assert!(! key.has_secret());
} else {
    unreachable!();
}

§Conversions

Sometimes it is necessary to change a marker. For instance, to help prevent a user from inadvertently leaking secret key material, the Cert data structure never returns keys with the key::SecretParts marker. This means, to use any secret key material, e.g., when creating a Signer, the user needs to explicitly opt-in by changing the marker using Key::parts_into_secret or Key::parts_as_secret.

For P, the conversion functions are: Key::parts_into_public, Key::parts_as_public, Key::parts_into_secret, Key::parts_as_secret, Key::parts_into_unspecified, and Key::parts_as_unspecified. With the exception of converting P to key::SecretParts, these functions are infallible. Converting P to key::SecretParts may fail if the key doesn’t have any secret key material. (Note: although the secret key material is required, it not checked for validity.)

For R, the conversion functions are Key::role_into_primary, Key::role_as_primary, Key::role_into_subordinate, Key::role_as_subordinate, Key::role_into_unspecified, and Key::role_as_unspecified.

It is also possible to use From.

§Examples

Changing a marker:

use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::packet::prelude::*;

// Generate a new certificate.  It has secret key material.
let (cert, _) = CertBuilder::new()
    .generate()?;

let pk: &Key<key::PublicParts, key::PrimaryRole>
    = cert.primary_key().key();
// `has_secret`s is one of the few methods that ignores the
// parts type.
assert!(pk.has_secret());

// Treat it like a secret key.  This only works if `pk` really
// has secret key material (which it does in this case, see above).
let sk = pk.parts_as_secret()?;
assert!(sk.has_secret());

// And back.
let pk = sk.parts_as_public();
// Yes, the secret key material is still there.
assert!(pk.has_secret());

The Cert data structure only returns public keys. To work with any secret key material, the Key first needs to be converted to a secret key. This is necessary, for instance, when creating a Signer:

use std::time;
use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::crypto::KeyPair;
use openpgp::policy::StandardPolicy;

let p = &StandardPolicy::new();

let the_past = time::SystemTime::now() - time::Duration::from_secs(1);
let (cert, _) = CertBuilder::new()
    .set_creation_time(the_past)
    .generate()?;

// Set the certificate to expire now.  To do this, we need
// to create a new self-signature, and sign it using a
// certification-capable key.  The primary key is always
// certification capable.
let mut keypair = cert.primary_key()
    .key().clone().parts_into_secret()?.into_keypair()?;
let sigs = cert.set_expiration_time(p, None, &mut keypair,
                                    Some(time::SystemTime::now()))?;

let cert = cert.insert_packets(sigs)?;
// It's expired now.
assert!(cert.with_policy(p, None)?.alive().is_err());

§Key Generation

Key is a wrapper around the different key formats. (Currently, Sequoia only supports version 4 keys, however, future versions may add limited support for version 3 keys to facilitate working with achieved messages, and RFC 4880bis includes a proposal for a new key format.) As such, it doesn’t provide a mechanism to generate keys or import existing key material. Instead, use the format-specific functions (e.g., Key4::generate_ecc) and then convert the result into a Key packet, as the following example demonstrates.

§Examples

use sequoia_openpgp as openpgp;
use openpgp::packet::prelude::*;
use openpgp::types::Curve;

let key: Key<key::SecretParts, key::PrimaryRole>
    = Key::from(Key4::generate_ecc(true, Curve::Ed25519)?);

§Password Protection

OpenPGP provides a mechanism to password protect keys. If a key is password protected, you need to decrypt the password using Key::decrypt_secret before using its secret key material (e.g., to decrypt a message, or to generate a signature).

§A note on equality

The implementation of Eq for Key compares the serialized form of Keys. Comparing or serializing values of Key<PublicParts, _> ignore secret key material, whereas the secret key material is considered and serialized for Key<SecretParts, _>, and for Key<UnspecifiedParts, _> if present. To explicitly exclude the secret key material from the comparison, use Key::public_cmp or Key::public_eq.

When merging in secret key material from untrusted sources, you need to be very careful: secret key material is not cryptographically protected by the key’s self signature. Thus, an attacker can provide a valid key with a valid self signature, but invalid secret key material. If naively merged, this could overwrite valid secret key material, and thereby render the key useless. Unfortunately, the only way to find out that the secret key material is bad is to actually try using it. But, because the secret key material is usually encrypted, this can’t always be done automatically.

Compare:

use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::packet::prelude::*;
use openpgp::packet::key::*;

// Generate a new certificate.  It has secret key material.
let (cert, _) = CertBuilder::new()
    .generate()?;

let sk: &Key<PublicParts, _> = cert.primary_key().key();
assert!(sk.has_secret());

// Strip the secret key material.
let cert = cert.clone().strip_secret_key_material();
let pk: &Key<PublicParts, _> = cert.primary_key().key();
assert!(! pk.has_secret());

// Eq on Key<PublicParts, _> compares only the public bits, so it
// considers pk and sk to be equal.
assert_eq!(pk, sk);

// Convert to Key<UnspecifiedParts, _>.
let sk: &Key<UnspecifiedParts, _> = sk.parts_as_unspecified();
let pk: &Key<UnspecifiedParts, _> = pk.parts_as_unspecified();

// Eq on Key<UnspecifiedParts, _> compares both the public and the
// secret bits, so it considers pk and sk to be different.
assert_ne!(pk, sk);

// In any case, Key::public_eq only compares the public bits,
// so it considers them to be equal.
assert!(Key::public_eq(pk, sk));

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

V4(Key4<P, R>)

A version 4 Key packet.

Implementations§

source§

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

source

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

Changes the key’s parts tag to PublicParts.

source

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

Changes the key’s parts tag to PublicParts.

source

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

Changes the key’s parts tag to PublicParts.

source

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

Changes the key’s parts tag to SecretParts.

source

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

Changes the key’s parts tag to SecretParts.

source

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

Changes the key’s parts tag to SecretParts.

source

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

Changes the key’s parts tag to UnspecifiedParts.

source

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

Changes the key’s parts tag to UnspecifiedParts.

source

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

Changes the key’s parts tag to UnspecifiedParts.

source§

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

source

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

Changes the key’s role tag to PrimaryRole.

source

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

Changes the key’s role tag to PrimaryRole.

source

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

Changes the key’s role tag to PrimaryRole.

source

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

Changes the key’s role tag to SubordinateRole.

source

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

Changes the key’s role tag to SubordinateRole.

source

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

Changes the key’s role tag to SubordinateRole.

source

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

Changes the key’s role tag to UnspecifiedRole.

source

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

Changes the key’s role tag to UnspecifiedRole.

source

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

Changes the key’s role tag to UnspecifiedRole.

source§

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

Cryptographic operations using the key material.

source

pub fn encrypt(&self, data: &SessionKey) -> Result<Ciphertext>

Encrypts the given data with this key.

source

pub fn verify( &self, sig: &Signature, hash_algo: HashAlgorithm, digest: &[u8] ) -> Result<()>

Verifies the given signature.

source§

impl<P: KeyParts, R: KeyRole> Key<P, R>

source

pub fn version(&self) -> u8

Gets the version.

source

pub fn public_cmp<PB, RB>(&self, b: &Key<PB, RB>) -> Ordering
where 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 Keys match. This does not consider the packet’s encoding, packet’s tag or the secret key material.

source

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

This method tests for self and other values to be equal modulo the secret key material.

This returns true if the public MPIs, creation time and algorithm of the two Keys match. This does not consider the packet’s encoding, packet’s tag or the secret key material.

source§

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

source

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

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

If the Key is password protected, you first need to decrypt it using Key::decrypt_secret.

§Errors

Fails if the secret key is encrypted.

§Examples

Revoke a certificate by signing a new revocation certificate:

use std::time;
use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::crypto::KeyPair;
use openpgp::types::ReasonForRevocation;

// Generate a certificate.
let (cert, _) =
    CertBuilder::general_purpose(None,
                                 Some("Alice Lovelace <alice@example.org>"))
        .generate()?;

// Use the secret key material to sign a revocation certificate.
let mut keypair = cert.primary_key()
    .key().clone().parts_into_secret()?
    .into_keypair()?;
let rev = cert.revoke(&mut keypair,
                      ReasonForRevocation::KeyCompromised,
                      b"It was the maid :/")?;
source

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

Decrypts the secret key material.

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

This function takes ownership of the Key, decrypts the secret key material using the password, and returns a new key whose secret key material is not password protected.

If the secret key material is not password protected or if the password is wrong, this function returns an error.

§Examples

Sign a new revocation certificate using a password-protected key:

use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::types::ReasonForRevocation;

// Generate a certificate whose secret key material is
// password protected.
let (cert, _) =
    CertBuilder::general_purpose(None,
                                 Some("Alice Lovelace <alice@example.org>"))
        .set_password(Some("1234".into()))
        .generate()?;

// Use the secret key material to sign a revocation certificate.
let key = cert.primary_key().key().clone().parts_into_secret()?;

// We can't turn it into a keypair without decrypting it.
assert!(key.clone().into_keypair().is_err());

// And, we need to use the right password.
assert!(key.clone()
    .decrypt_secret(&"correct horse battery staple".into())
    .is_err());

// Let's do it right:
let mut keypair = key.decrypt_secret(&"1234".into())?.into_keypair()?;
let rev = cert.revoke(&mut keypair,
                      ReasonForRevocation::KeyCompromised,
                      b"It was the maid :/")?;
source

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

Encrypts the secret key material.

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

This function takes ownership of the Key, encrypts the secret key material using the password, and returns a new key whose secret key material is protected with the password.

If the secret key material is already password protected, this function returns an error.

§Examples

This example demonstrates how to encrypt the secret key material of every key in a certificate. Decryption can be done the same way with Key::decrypt_secret.

use sequoia_openpgp as openpgp;
use openpgp::cert::prelude::*;
use openpgp::packet::Packet;

// Generate a certificate whose secret key material is
// not password protected.
let (cert, _) =
    CertBuilder::general_purpose(None,
                                 Some("Alice Lovelace <alice@example.org>"))
        .generate()?;

// Encrypt every key.
let mut encrypted_keys: Vec<Packet> = Vec::new();
for ka in cert.keys().secret() {
    assert!(ka.has_unencrypted_secret());

    // Encrypt the key's secret key material.
    let key = ka.key().clone().encrypt_secret(&"1234".into())?;
    assert!(! key.has_unencrypted_secret());

    // We cannot merge it right now, because `cert` is borrowed.
    encrypted_keys.push(if ka.primary() {
        key.role_into_primary().into()
    } else {
        key.role_into_subordinate().into()
    });
}

// Merge the keys into the certificate.  Note: `Cert::insert_packets`
// prefers added versions of keys.  So, the encrypted version
// will override the decrypted version.
let cert = cert.insert_packets(encrypted_keys)?;

// Now the every key's secret key material is encrypted.  We'll
// demonstrate this using the primary key:
let key = cert.primary_key().key().parts_as_secret()?;
assert!(! key.has_unencrypted_secret());

// We can't turn it into a keypair without decrypting it.
assert!(key.clone().into_keypair().is_err());

// And, we need to use the right password.
assert!(key.clone()
    .decrypt_secret(&"correct horse battery staple".into())
    .is_err());

// Let's do it right:
let mut keypair = key.clone()
    .decrypt_secret(&"1234".into())?.into_keypair()?;
source§

impl<R: KeyRole> Key<PublicParts, R>

Secret key handling.

source

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

Takes the key packet’s SecretKeyMaterial, if any.

source

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

Adds SecretKeyMaterial to the packet, returning the old if any.

source§

impl<R: KeyRole> Key<UnspecifiedParts, R>

Secret key handling.

source

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

Takes the key packet’s SecretKeyMaterial, if any.

source

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

Adds SecretKeyMaterial to the packet, returning the old if any.

source§

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

Secret key handling.

source

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

Takes the key packet’s SecretKeyMaterial.

source

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

Adds SecretKeyMaterial to the packet, returning the old.

source§

impl<P: KeyParts> Key<P, SubordinateRole>

source

pub fn bind( &self, signer: &mut dyn Signer, cert: &Cert, signature: SignatureBuilder ) -> Result<Signature>

Creates a binding signature.

The signature binds this subkey 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.

Note that subkeys with signing capabilities need a primary key binding signature. If you are creating this binding signature from a previous binding signature, you can reuse the primary key binding signature if it is still valid and meets current algorithm requirements. Otherwise, you can create one using SignatureBuilder::sign_primary_key_binding.

This function adds a creation time subpacket, a issuer fingerprint subpacket, and a issuer subpacket to the signature.

§Examples

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::empty().set_storage_encryption();
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::SignatureBuilder::new(SignatureType::SubkeyBinding)
    .set_key_flags(flags.clone())?;
let binding = subkey.bind(&mut keypair, &cert, builder)?;

// Now merge the key and binding signature into the Cert.
let cert = cert.insert_packets(vec![Packet::from(subkey),
                                   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>>§

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_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_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

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_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_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

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

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

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.

Trait Implementations§

source§

impl Any<Key<PublicParts, PrimaryRole>> for Packet

source§

fn downcast(self) -> Result<Key<PublicParts, PrimaryRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<PublicParts, PrimaryRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<PublicParts, PrimaryRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<PublicParts, SubordinateRole>> for Packet

source§

fn downcast(self) -> Result<Key<PublicParts, SubordinateRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<PublicParts, SubordinateRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<PublicParts, SubordinateRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<PublicParts, UnspecifiedRole>> for Packet

source§

fn downcast(self) -> Result<Key<PublicParts, UnspecifiedRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<PublicParts, UnspecifiedRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<PublicParts, UnspecifiedRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<SecretParts, PrimaryRole>> for Packet

source§

fn downcast(self) -> Result<Key<SecretParts, PrimaryRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<SecretParts, PrimaryRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<SecretParts, PrimaryRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<SecretParts, SubordinateRole>> for Packet

source§

fn downcast(self) -> Result<Key<SecretParts, SubordinateRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<SecretParts, SubordinateRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<SecretParts, SubordinateRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<SecretParts, UnspecifiedRole>> for Packet

source§

fn downcast(self) -> Result<Key<SecretParts, UnspecifiedRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<SecretParts, UnspecifiedRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<SecretParts, UnspecifiedRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<UnspecifiedParts, PrimaryRole>> for Packet

source§

fn downcast(self) -> Result<Key<UnspecifiedParts, PrimaryRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<UnspecifiedParts, PrimaryRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<UnspecifiedParts, PrimaryRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<UnspecifiedParts, SubordinateRole>> for Packet

source§

fn downcast(self) -> Result<Key<UnspecifiedParts, SubordinateRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<UnspecifiedParts, SubordinateRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut( &mut self ) -> Option<&mut Key<UnspecifiedParts, SubordinateRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<UnspecifiedParts, UnspecifiedRole>> for Packet

source§

fn downcast(self) -> Result<Key<UnspecifiedParts, UnspecifiedRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<UnspecifiedParts, UnspecifiedRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut( &mut self ) -> Option<&mut Key<UnspecifiedParts, UnspecifiedRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl<P: Clone + KeyParts, R: Clone + KeyRole> Clone for Key<P, R>

source§

fn clone(&self) -> Key<P, R>

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: Debug + KeyParts, R: Debug + KeyRole> Debug for Key<P, R>

source§

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

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

impl<P: KeyParts, R: KeyRole> DerefMut for Key<P, R>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<P: KeyParts, R: KeyRole> Display for Key<P, R>

source§

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

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

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl<'a, P, R> From<&'a Key<P, R>> for Recipient<'a>
where P: KeyParts, R: KeyRole,

source§

fn from(key: &'a Key<P, R>) -> Self

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl From<Key<PublicParts, PrimaryRole>> for Packet

source§

fn from(k: Key<PublicParts, PrimaryRole>) -> Self

Convert the Key struct to a Packet.

source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl From<Key<PublicParts, SubordinateRole>> for Packet

source§

fn from(k: Key<PublicParts, SubordinateRole>) -> Self

Convert the Key struct to a Packet.

source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl From<Key<SecretParts, PrimaryRole>> for Packet

source§

fn from(k: Key<SecretParts, PrimaryRole>) -> Self

Convert the Key struct to a Packet.

source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl From<Key<SecretParts, SubordinateRole>> for Packet

source§

fn from(k: Key<SecretParts, SubordinateRole>) -> Self

Convert the Key struct to a Packet.

source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

fn from(p: Key<UnspecifiedParts, UnspecifiedRole>) -> 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 From<KeyPair> for Key<SecretParts, UnspecifiedRole>

source§

fn from(p: KeyPair) -> Self

Converts to this type from the input type.
source§

impl<P: Hash + KeyParts, R: Hash + KeyRole> Hash for Key<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> IntoIterator for Key<P, R>
where P: KeyParts, R: KeyRole,

Implement IntoIterator so that cert::insert_packets(sig) just works.

§

type Item = Key<P, R>

The type of the elements being iterated over.
§

type IntoIter = Once<Key<P, R>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<P: KeyParts, R: KeyRole> Marshal for Key<P, R>

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: KeyParts, R: KeyRole> MarshalInto for Key<P, R>

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<'a> Parse<'a, Key<UnspecifiedParts, UnspecifiedRole>> for Key<UnspecifiedParts, UnspecifiedRole>

source§

fn from_buffered_reader<R>(reader: R) -> Result<Self>
where R: BufferedReader<Cookie> + 'a,

Reads from the given buffered reader.
source§

fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>

Reads from the given reader.
source§

fn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>( data: &'a D ) -> Result<Self>

Reads from the given slice. Read more
source§

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>

Reads from the given file. Read more
source§

impl<P: PartialEq + KeyParts, R: PartialEq + KeyRole> PartialEq for Key<P, R>

source§

fn eq(&self, other: &Key<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<&Key<PublicParts, PrimaryRole>> for &Key<SecretParts, SubordinateRole>

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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>,

source§

fn cert(&self) -> &ValidCert<'a>

Returns the valid amalgamation’s associated certificate. Read more
source§

fn time(&self) -> SystemTime

Returns the amalgamation’s reference time. Read more
source§

fn policy(&self) -> &'a dyn Policy

Returns the amalgamation’s policy. Read more
source§

fn binding_signature(&self) -> &'a Signature

Returns the component’s binding signature as of the reference time. Read more
source§

fn revocation_status(&self) -> RevocationStatus<'a>

Returns the component’s revocation status as of the amalgamation’s reference time. Read more
source§

fn revocation_keys(&self) -> Box<dyn Iterator<Item = &'a RevocationKey> + 'a>

Returns a list of any designated revokers for this component. Read more
source§

fn map<F: Fn(&'a Signature) -> Option<T>, T>(&self, f: F) -> Option<T>

Maps the given function over binding and direct key signature. Read more
source§

fn direct_key_signature(&self) -> Result<&'a Signature>

Returns the certificate’s direct key signature as of the reference time, if any. Read more
source§

impl<'a, P> ValidateAmalgamation<'a, Key<P, PrimaryRole>> for PrimaryKeyAmalgamation<'a, P>
where P: 'a + KeyParts,

§

type V = ValidKeyAmalgamation<'a, P, PrimaryRole, ()>

The type returned by with_policy. Read more
source§

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V>
where T: Into<Option<SystemTime>>,

Uses the specified Policy and reference time with the amalgamation. Read more
source§

impl<'a, P> ValidateAmalgamation<'a, Key<P, PrimaryRole>> for ValidPrimaryKeyAmalgamation<'a, P>
where P: 'a + KeyParts,

§

type V = ValidKeyAmalgamation<'a, P, PrimaryRole, ()>

The type returned by with_policy. Read more
source§

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V>
where T: Into<Option<SystemTime>>, Self: Sized,

Uses the specified Policy and reference time with the amalgamation. Read more
source§

impl<'a, P> ValidateAmalgamation<'a, Key<P, SubordinateRole>> for SubordinateKeyAmalgamation<'a, P>
where P: 'a + KeyParts,

§

type V = ValidKeyAmalgamation<'a, P, SubordinateRole, ()>

The type returned by with_policy. Read more
source§

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V>
where T: Into<Option<SystemTime>>,

Uses the specified Policy and reference time with the amalgamation. Read more
source§

impl<'a, P> ValidateAmalgamation<'a, Key<P, SubordinateRole>> for ValidSubordinateKeyAmalgamation<'a, P>
where P: 'a + KeyParts,

§

type V = ValidKeyAmalgamation<'a, P, SubordinateRole, ()>

The type returned by with_policy. Read more
source§

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V>
where T: Into<Option<SystemTime>>, Self: Sized,

Uses the specified Policy and reference time with the amalgamation. Read more
source§

impl<'a, P> ValidateAmalgamation<'a, Key<P, UnspecifiedRole>> for ErasedKeyAmalgamation<'a, P>
where P: 'a + KeyParts,

§

type V = ValidKeyAmalgamation<'a, P, UnspecifiedRole, bool>

The type returned by with_policy. Read more
source§

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V>
where T: Into<Option<SystemTime>>,

Uses the specified Policy and reference time with the amalgamation. Read more
source§

impl<'a, P> ValidateAmalgamation<'a, Key<P, UnspecifiedRole>> for ValidErasedKeyAmalgamation<'a, P>
where P: 'a + KeyParts,

§

type V = ValidKeyAmalgamation<'a, P, UnspecifiedRole, bool>

The type returned by with_policy. Read more
source§

fn with_policy<T>(self, policy: &'a dyn Policy, time: T) -> Result<Self::V>
where T: Into<Option<SystemTime>>, Self: Sized,

Uses the specified Policy and reference time with the amalgamation. Read more
source§

impl<P: KeyParts, R: KeyRole> Deref for Key<P, R>

§

type Target = Key4<P, R>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<P: Eq + KeyParts, R: Eq + KeyRole> Eq for Key<P, R>

source§

impl<P: KeyParts, R: KeyRole> StructuralPartialEq for Key<P, R>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<P, R> UnwindSafe for Key<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> 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.