Type Alias sequoia_openpgp::cert::amalgamation::ValidUserIDAmalgamation

source ·
pub type ValidUserIDAmalgamation<'a> = ValidComponentAmalgamation<'a, UserID>;
Expand description

A Valid User ID and its associated data.

A specialized version of ValidComponentAmalgamation.

Aliased Type§

struct ValidUserIDAmalgamation<'a> { /* private fields */ }

Implementations§

source§

impl<'a> ValidUserIDAmalgamation<'a>

source

pub fn attested_certifications( &self, ) -> impl Iterator<Item = &Signature> + Send + Sync

Returns the userid’s attested third-party certifications.

This feature is experimental.

Allows the certificate owner to attest to third party certifications. See Section 5.2.3.30 of RFC 4880bis for details. This can be used to address certificate flooding concerns.

This method only returns signatures that are valid under the current policy and are attested by the certificate holder.

source

pub fn attestation_key_signatures( &'a self, ) -> impl Iterator<Item = &'a Signature> + Send + Sync

Returns set of active attestation key signatures.

This feature is experimental.

Returns the set of signatures with the newest valid signature creation time. Older signatures are not returned. The sum of all digests in these signatures are the set of attested third-party certifications.

This interface is useful for pruning old attestation key signatures when filtering a certificate.

Note: This is a low-level interface. Consider using ValidUserIDAmalgamation::attested_certifications to iterate over all attested certifications.

source

pub fn attest_certifications<C, S>( &self, primary_signer: &mut dyn Signer, certifications: C, ) -> Result<Vec<Signature>>
where C: IntoIterator<Item = S>, S: Borrow<Signature>,

Attests to third-party certifications.

This feature is experimental.

Allows the certificate owner to attest to third party certifications. See Section 5.2.3.30 of RFC 4880bis for details. This can be used to address certificate flooding concerns.

§Examples
let (alice, _) = CertBuilder::new()
    .add_userid("alice@example.org")
    .generate()?;
let mut alice_signer =
    alice.primary_key().key().clone().parts_into_secret()?
    .into_keypair()?;

let (bob, _) = CertBuilder::new()
    .add_userid("bob@example.org")
    .generate()?;
let mut bob_signer =
    bob.primary_key().key().clone().parts_into_secret()?
    .into_keypair()?;
let bob_pristine = bob.clone();

// Have Alice certify the binding between "bob@example.org" and
// Bob's key.
let alice_certifies_bob
    = bob.userids().next().unwrap().userid().bind(
        &mut alice_signer, &bob,
        SignatureBuilder::new(SignatureType::GenericCertification))?;
let bob = bob.insert_packets(vec![alice_certifies_bob.clone()])?;

// Have Bob attest that certification.
let bobs_uid = bob.userids().next().unwrap();
let attestations =
    bobs_uid.attest_certifications(
        policy,
        &mut bob_signer,
        bobs_uid.certifications())?;
let bob = bob.insert_packets(attestations)?;

assert_eq!(bob.bad_signatures().count(), 0);
assert_eq!(bob.userids().next().unwrap().certifications().next(),
           Some(&alice_certifies_bob));