summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-02-06 14:15:10 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-02-06 14:15:10 +0100
commitd183e12a3231e4c505f5f2cf48b6c1f881ad258a (patch)
treeaffb4e4c0acc3bce3d14adba627f5193c166bc32 /openpgp
parentc8eb94375a38e5606441a9e86d402442662ffb02 (diff)
openpgp: Rename ComponentBinding to ComponentBundle, etc.
- Likewise KeyBinding, UserIDBinding, UserAttributeBinding, UnknownBinding, etc. - Reason: a self-signature on a component is a binding, but revocations and TPSes are not bindings. - Consistently call collections of components and associated signatures bundles now. Likewise for fields, methods. - Fixes #425.
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/examples/web-of-trust.rs2
-rw-r--r--openpgp/src/autocrypt.rs2
-rw-r--r--openpgp/src/cert/amalgamation.rs26
-rw-r--r--openpgp/src/cert/bindings.rs4
-rw-r--r--openpgp/src/cert/builder.rs2
-rw-r--r--openpgp/src/cert/component_iter.rs18
-rw-r--r--openpgp/src/cert/components.rs64
-rw-r--r--openpgp/src/cert/key_amalgamation.rs100
-rw-r--r--openpgp/src/cert/keyiter.rs56
-rw-r--r--openpgp/src/cert/mod.rs98
-rw-r--r--openpgp/src/cert/parser/low_level/grammar.lalrpop38
-rw-r--r--openpgp/src/cert/parser/low_level/lexer.rs16
-rw-r--r--openpgp/src/cert/parser/mod.rs6
-rw-r--r--openpgp/src/crypto/hash.rs4
-rw-r--r--openpgp/src/packet/key/mod.rs4
-rw-r--r--openpgp/src/packet/signature/mod.rs2
-rw-r--r--openpgp/src/serialize/cert.rs24
-rw-r--r--openpgp/src/serialize/cert_armored.rs2
18 files changed, 234 insertions, 234 deletions
diff --git a/openpgp/examples/web-of-trust.rs b/openpgp/examples/web-of-trust.rs
index 71ddbc4f..123d4a53 100644
--- a/openpgp/examples/web-of-trust.rs
+++ b/openpgp/examples/web-of-trust.rs
@@ -38,7 +38,7 @@ fn main() {
match cert {
Ok(cert) => {
let keyid = cert.keyid();
- for uidb in cert.userids().bindings() {
+ for uidb in cert.userids().bundles() {
for tps in uidb.certifications() {
for issuer in tps.get_issuers() {
println!("{}, {:?}, {}",
diff --git a/openpgp/src/autocrypt.rs b/openpgp/src/autocrypt.rs
index c99ee4e1..22dfa40d 100644
--- a/openpgp/src/autocrypt.rs
+++ b/openpgp/src/autocrypt.rs
@@ -109,7 +109,7 @@ impl AutocryptHeader {
let mut acc = Vec::new();
// The primary key and the most recent selfsig.
- let primary = cert.primary_key().binding();
+ let primary = cert.primary_key().bundle();
acc.push(primary.key().clone().mark_role_primary().into());
primary.self_signatures().iter().take(1)
.for_each(|s| acc.push(s.clone().into()));
diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs
index cd9b2079..10ee8d5b 100644
--- a/openpgp/src/cert/amalgamation.rs
+++ b/openpgp/src/cert/amalgamation.rs
@@ -3,7 +3,7 @@ use std::time::SystemTime;
use crate::{
Cert,
- cert::components::ComponentBinding,
+ cert::components::ComponentBundle,
Error,
packet::Signature,
Result,
@@ -15,24 +15,24 @@ use crate::{
#[derive(Debug, Clone)]
pub struct ComponentAmalgamation<'a, C>{
cert: &'a Cert,
- binding: &'a ComponentBinding<C>,
+ bundle: &'a ComponentBundle<C>,
}
impl<'a, C> std::ops::Deref for ComponentAmalgamation<'a, C> {
type Target = C;
fn deref(&self) -> &Self::Target {
- self.binding.component()
+ self.bundle.component()
}
}
impl<'a, C> ComponentAmalgamation<'a, C> {
/// Creates a new amalgamation.
- pub(crate) fn new(cert: &'a Cert, binding: &'a ComponentBinding<C>) -> Self
+ pub(crate) fn new(cert: &'a Cert, bundle: &'a ComponentBundle<C>) -> Self
{
Self {
cert,
- binding,
+ bundle,
}
}
@@ -41,9 +41,9 @@ impl<'a, C> ComponentAmalgamation<'a, C> {
self.cert
}
- /// Returns this component's component binding.
- pub fn binding(&self) -> &'a ComponentBinding<C> {
- &self.binding
+ /// Returns this component's bundle.
+ pub fn bundle(&self) -> &'a ComponentBundle<C> {
+ &self.bundle
}
/// Returns the components's binding signature as of the reference
@@ -56,7 +56,7 @@ impl<'a, C> ComponentAmalgamation<'a, C> {
where T: Into<Option<time::SystemTime>>
{
let time = time.into().unwrap_or_else(SystemTime::now);
- self.binding.binding_signature(policy, time)
+ self.bundle.binding_signature(policy, time)
}
/// Sets the reference time for the amalgamation.
@@ -86,14 +86,14 @@ impl<'a, C> ComponentAmalgamation<'a, C> {
impl<'a> ComponentAmalgamation<'a, crate::packet::UserID> {
/// Returns a reference to the User ID.
pub fn userid(&self) -> &crate::packet::UserID {
- self.binding().userid()
+ self.bundle().userid()
}
}
impl<'a> ComponentAmalgamation<'a, crate::packet::UserAttribute> {
/// Returns a reference to the User Attribute.
pub fn user_attribute(&self) -> &crate::packet::UserAttribute {
- self.binding().user_attribute()
+ self.bundle().user_attribute()
}
}
@@ -134,7 +134,7 @@ impl<'a, C> ValidComponentAmalgamation<'a, C>
/// If there is more than one, than one is selected in a
/// deterministic, but undefined manner.
pub(super) fn primary(cert: &'a Cert,
- iter: std::slice::Iter<'a, ComponentBinding<C>>,
+ iter: std::slice::Iter<'a, ComponentBundle<C>>,
policy: &'a dyn Policy, t: SystemTime)
-> Option<ValidComponentAmalgamation<'a, C>>
{
@@ -298,7 +298,7 @@ impl<'a, C> Amalgamation<'a> for ValidComponentAmalgamation<'a, C> {
///
/// Note: this does not return whether the certificate is valid.
fn revoked(&self) -> RevocationStatus<'a> {
- self.binding._revoked(self.policy(), self.time,
+ self.bundle._revoked(self.policy(), self.time,
false, Some(self.binding_signature))
}
}
diff --git a/openpgp/src/cert/bindings.rs b/openpgp/src/cert/bindings.rs
index 83d319a2..40a326d8 100644
--- a/openpgp/src/cert/bindings.rs
+++ b/openpgp/src/cert/bindings.rs
@@ -173,7 +173,7 @@ impl UserID {
/// let bob = bob.merge_packets(vec![certificate.into()])?;
///
/// // Check that we have a certification on the userid.
- /// assert_eq!(bob.userids().bindings().nth(0).unwrap()
+ /// assert_eq!(bob.userids().bundles().nth(0).unwrap()
/// .certifications().len(), 1);
/// # Ok(()) }
pub fn certify<S, H, T>(&self, signer: &mut dyn Signer, cert: &Cert,
@@ -315,7 +315,7 @@ impl UserAttribute {
/// let bob = bob.merge_packets(vec![certificate.into()])?;
///
/// // Check that we have a certification on the userid.
- /// assert_eq!(bob.user_attributes().bindings().nth(0).unwrap()
+ /// assert_eq!(bob.user_attributes().bundles().nth(0).unwrap()
/// .certifications().len(),
/// 1);
/// # Ok(()) }
diff --git a/openpgp/src/cert/builder.rs b/openpgp/src/cert/builder.rs
index f950b484..c09d90ae 100644
--- a/openpgp/src/cert/builder.rs
+++ b/openpgp/src/cert/builder.rs
@@ -668,7 +668,7 @@ mod tests {
let now = cert.primary_key().creation_time()
+ 5 * s; // The subkeys may be created a tad later.
let key = cert.primary_key().key();
- let sig = &cert.primary_key().binding().self_signatures()[0];
+ let sig = &cert.primary_key().bundle().self_signatures()[0];
assert!(sig.key_alive(key, now).is_ok());
assert!(sig.key_alive(key, now + 590 * s).is_ok());
assert!(! sig.key_alive(key, now + 610 * s).is_ok());
diff --git a/openpgp/src/cert/component_iter.rs b/openpgp/src/cert/component_iter.rs
index 9cd9cada..879c673c 100644
--- a/openpgp/src/cert/component_iter.rs
+++ b/openpgp/src/cert/component_iter.rs
@@ -6,8 +6,8 @@ use crate::{
cert::{
Cert,
components::{
- ComponentBinding,
- ComponentBindingIter,
+ ComponentBundle,
+ ComponentBundleIter,
Amalgamation,
ComponentAmalgamation,
ValidComponentAmalgamation,
@@ -25,7 +25,7 @@ use crate::{
/// By default, `ComponentIter` returns all components without context.
pub struct ComponentIter<'a, C> {
cert: &'a Cert,
- iter: ComponentBindingIter<'a, C>,
+ iter: ComponentBundleIter<'a, C>,
}
impl<'a, C> fmt::Debug for ComponentIter<'a, C> {
@@ -46,11 +46,11 @@ impl<'a, C> Iterator for ComponentIter<'a, C> {
impl<'a, C> ComponentIter<'a, C> {
/// Returns a new `ComponentIter` instance.
pub(crate) fn new(cert: &'a Cert,
- iter: std::slice::Iter<'a, ComponentBinding<C>>) -> Self
+ iter: std::slice::Iter<'a, ComponentBundle<C>>) -> Self
where Self: 'a
{
ComponentIter {
- cert, iter: ComponentBindingIter { iter: Some(iter), },
+ cert, iter: ComponentBundleIter { iter: Some(iter), },
}
}
@@ -78,7 +78,7 @@ impl<'a, C> ComponentIter<'a, C> {
/// A component binding is similar to a component amalgamation,
/// but is not bound to a specific time. It contains the
/// component and all relevant signatures.
- pub fn bindings(self) -> ComponentBindingIter<'a, C> {
+ pub fn bundles(self) -> ComponentBundleIter<'a, C> {
self.iter
}
}
@@ -94,7 +94,7 @@ impl<'a, C> ComponentIter<'a, C> {
pub struct ValidComponentIter<'a, C> {
// This is an option to make it easier to create an empty ValidComponentIter.
cert: &'a Cert,
- iter: ComponentBindingIter<'a, C>,
+ iter: ComponentBundleIter<'a, C>,
policy: &'a dyn Policy,
// The time.
@@ -125,7 +125,7 @@ impl<'a, C> Iterator for ValidComponentIter<'a, C>
loop {
let ca = ComponentAmalgamation::new(self.cert, self.iter.next()?);
- t!("Considering component: {:?}", ca.binding());
+ t!("Considering component: {:?}", ca.bundle());
let vca
= if let Ok(vca) = ca.set_policy(self.policy, self.time) {
@@ -214,7 +214,7 @@ impl<'a, C> ValidComponentIter<'a, C> {
/// true,
/// }
/// })
- /// .map(|ca| ca.binding())
+ /// .map(|ca| ca.bundle())
/// .collect::<Vec<_>>();
/// # Ok(())
/// # }
diff --git a/openpgp/src/cert/components.rs b/openpgp/src/cert/components.rs
index 5258c493..1074899c 100644
--- a/openpgp/src/cert/components.rs
+++ b/openpgp/src/cert/components.rs
@@ -31,14 +31,14 @@ pub use super::amalgamation::{
/// A key (primary or subkey, public or private) and any associated
/// signatures.
-pub type KeyBinding<KeyPart, KeyRole> = ComponentBinding<Key<KeyPart, KeyRole>>;
+pub type KeyBundle<KeyPart, KeyRole> = ComponentBundle<Key<KeyPart, KeyRole>>;
-impl<K: key::KeyParts, R: key::KeyRole> KeyBinding<K, R>
+impl<K: key::KeyParts, R: key::KeyRole> KeyBundle<K, R>
{
/// Gets the key packet's `SecretKeyMaterial`.
///
/// Note: The key module installs conversion functions on
- /// KeyBinding. They need to access the key's secret.
+ /// KeyBundle. They need to access the key's secret.
pub(crate) fn secret(&self)
-> Option<&crate::packet::key::SecretKeyMaterial> {
self.key().secret()
@@ -46,28 +46,28 @@ impl<K: key::KeyParts, R: key::KeyRole> KeyBinding<K, R>
}
/// A primary key and any associated signatures.
-pub(crate) type PrimaryKeyBinding<KeyPart> =
- KeyBinding<KeyPart, key::PrimaryRole>;
+pub(crate) type PrimaryKeyBundle<KeyPart> =
+ KeyBundle<KeyPart, key::PrimaryRole>;
/// A subkey and any associated signatures.
-pub type SubkeyBinding<KeyPart> = KeyBinding<KeyPart, key::SubordinateRole>;
+pub type SubkeyBundle<KeyPart> = KeyBundle<KeyPart, key::SubordinateRole>;
/// A key (primary or subkey, public or private) and any associated
/// signatures.
#[allow(dead_code)]
type GenericKeyBinding
- = ComponentBinding<Key<key::UnspecifiedParts, key::UnspecifiedRole>>;
+ = ComponentBundle<Key<key::UnspecifiedParts, key::UnspecifiedRole>>;
/// A User ID and any associated signatures.
-pub type UserIDBinding = ComponentBinding<UserID>;
+pub type UserIDBundle = ComponentBundle<UserID>;
/// A User Attribute and any associated signatures.
-pub type UserAttributeBinding = ComponentBinding<UserAttribute>;
+pub type UserAttributeBundle = ComponentBundle<UserAttribute>;
/// An unknown component and any associated signatures.
///
/// Note: all signatures are stored as certifications.
-pub type UnknownBinding = ComponentBinding<Unknown>;
+pub type UnknownBundle = ComponentBundle<Unknown>;
/// A Cert component binding.
///
@@ -75,7 +75,7 @@ pub type UnknownBinding = ComponentBinding<Unknown>;
/// attribute. A binding is a Cert component and any related
/// signatures.
#[derive(Debug, Clone, PartialEq)]
-pub struct ComponentBinding<C> {
+pub struct ComponentBundle<C> {
pub(crate) component: C,
// Self signatures.
@@ -92,7 +92,7 @@ pub struct ComponentBinding<C> {
pub(crate) other_revocations: Vec<Signature>,
}
-impl<C> ComponentBinding<C> {
+impl<C> ComponentBundle<C> {
/// Returns a reference to the component.
pub fn component(&self) -> &C {
&self.component
@@ -232,7 +232,7 @@ impl<C> ComponentBinding<C> {
= selfsig.and_then(|s| s.signature_creation_time())
.unwrap_or_else(time_zero);
- tracer!(super::TRACE, "ComponentBinding::_revoked", 0);
+ tracer!(super::TRACE, "ComponentBundle::_revoked", 0);
t!("hard_revocations_are_final: {}, selfsig: {:?}, t: {:?}",
hard_revocations_are_final,
selfsig_creation_time,
@@ -360,7 +360,7 @@ impl<C> ComponentBinding<C> {
}
}
-impl<P: key::KeyParts, R: key::KeyRole> ComponentBinding<Key<P, R>> {
+impl<P: key::KeyParts, R: key::KeyRole> ComponentBundle<Key<P, R>> {
/// Returns a reference to the key.
pub fn key(&self) -> &Key<P, R> {
self.component()
@@ -372,7 +372,7 @@ impl<P: key::KeyParts, R: key::KeyRole> ComponentBinding<Key<P, R>> {
}
}
-impl<P: key::KeyParts> ComponentBinding<Key<P, key::SubordinateRole>> {
+impl<P: key::KeyParts> ComponentBundle<Key<P, key::SubordinateRole>> {
/// Returns the subkey's revocation status at time `t`.
///
/// A subkey is revoked at time `t` if:
@@ -397,7 +397,7 @@ impl<P: key::KeyParts> ComponentBinding<Key<P, key::SubordinateRole>> {
}
}
-impl ComponentBinding<UserID> {
+impl ComponentBundle<UserID> {
/// Returns a reference to the User ID.
pub fn userid(&self) -> &UserID {
self.component()
@@ -424,7 +424,7 @@ impl ComponentBinding<UserID> {
}
}
-impl ComponentBinding<UserAttribute> {
+impl ComponentBundle<UserAttribute> {
/// Returns a reference to the User Attribute.
pub fn user_attribute(&self) -> &UserAttribute {
self.component()
@@ -451,30 +451,30 @@ impl ComponentBinding<UserAttribute> {
}
}
-impl ComponentBinding<Unknown> {
+impl ComponentBundle<Unknown> {
/// Returns a reference to the unknown component.
pub fn unknown(&self) -> &Unknown {
self.component()
}
}
-/// An iterator over `ComponentBinding`s.
-pub struct ComponentBindingIter<'a, C> {
- pub(crate) iter: Option<slice::Iter<'a, ComponentBinding<C>>>,
+/// An iterator over `ComponentBundle`s.
+pub struct ComponentBundleIter<'a, C> {
+ pub(crate) iter: Option<slice::Iter<'a, ComponentBundle<C>>>,
}
-/// An iterator over `KeyBinding`s.
-pub type KeyBindingIter<'a, P, R> = ComponentBindingIter<'a, Key<P, R>>;
-/// An iterator over `UserIDBinding`s.
-pub type UserIDBindingIter<'a> = ComponentBindingIter<'a, UserID>;
-/// An iterator over `UserAttributeBinding`s.
-pub type UserAttributeBindingIter<'a> = ComponentBindingIter<'a, UserAttribute>;
-/// An iterator over `UnknownBinding`s.
-pub type UnknownBindingIter<'a> = ComponentBindingIter<'a, Unknown>;
+/// An iterator over `KeyBundle`s.
+pub type UnfilteredKeyBundleIter<'a, P, R> = ComponentBundleIter<'a, Key<P, R>>;
+/// An iterator over `UserIDBundle`s.
+pub type UserIDBundleIter<'a> = ComponentBundleIter<'a, UserID>;
+/// An iterator over `UserAttributeBundle`s.
+pub type UserAttributeBundleIter<'a> = ComponentBundleIter<'a, UserAttribute>;
+/// An iterator over `UnknownBundle`s.
+pub type UnknownBundleIter<'a> = ComponentBundleIter<'a, Unknown>;
-impl<'a, C> Iterator for ComponentBindingIter<'a, C>
+impl<'a, C> Iterator for ComponentBundleIter<'a, C>
{
- type Item = &'a ComponentBinding<C>;
+ type Item = &'a ComponentBundle<C>;
fn next(&mut self) -> Option<Self::Item> {
match self.iter {
@@ -484,7 +484,7 @@ impl<'a, C> Iterator for ComponentBindingIter<'a, C>
}
}
-impl<'a, C> ExactSizeIterator for ComponentBindingIter<'a, C>
+impl<'a, C> ExactSizeIterator for ComponentBundleIter<'a, C>
{
fn len(&self) -> usize {
match self.iter {
diff --git a/openpgp/src/cert/key_amalgamation.rs b/openpgp/src/cert/key_amalgamation.rs
index c9b7b4ed..1d736c1e 100644
--- a/openpgp/src/cert/key_amalgamation.rs
+++ b/openpgp/src/cert/key_amalgamation.rs
@@ -9,7 +9,7 @@ use crate::{
Cert,
cert::components::{
Amalgamation,
- KeyBinding,
+ KeyBundle,
},
Error,
packet::key,
@@ -28,16 +28,16 @@ use crate::{
/// must also all be public, and we don't want that here. Wrapping
/// this in a struct means that we can hide that.
#[derive(Debug, Clone)]
-enum KeyAmalgamationBinding<'a, P: key::KeyParts> {
+enum KeyAmalgamationBundle<'a, P: key::KeyParts> {
Primary(),
- Subordinate(&'a KeyBinding<P, key::SubordinateRole>),
+ Subordinate(&'a KeyBundle<P, key::SubordinateRole>),
}
/// A `Key` and its associated data.
#[derive(Debug, Clone)]
pub struct KeyAmalgamation<'a, P: key::KeyParts> {
cert: &'a Cert,
- binding: KeyAmalgamationBinding<'a, P>,
+ bundle: KeyAmalgamationBundle<'a, P>,
}
impl<'a, P: key::KeyParts> Deref for KeyAmalgamation<'a, P>
@@ -59,19 +59,19 @@ impl<'a> From<KeyAmalgamation<'a, key::PublicParts>>
match ka {
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Primary(),
+ bundle: KeyAmalgamationBundle::Primary(),
} =>
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Primary(),
+ bundle: KeyAmalgamationBundle::Primary(),
},
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Subordinate(binding),
+ bundle: KeyAmalgamationBundle::Subordinate(bundle),
} =>
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Subordinate(binding.into()),
+ bundle: KeyAmalgamationBundle::Subordinate(bundle.into()),
},
}
}
@@ -84,19 +84,19 @@ impl<'a> From<KeyAmalgamation<'a, key::SecretParts>>
match ka {
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Primary(),
+ bundle: KeyAmalgamationBundle::Primary(),
} =>
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Primary(),
+ bundle: KeyAmalgamationBundle::Primary(),
},
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Subordinate(binding),
+ bundle: KeyAmalgamationBundle::Subordinate(bundle),
} =>
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Subordinate(binding.into()),
+ bundle: KeyAmalgamationBundle::Subordinate(bundle.into()),
},
}
}
@@ -111,24 +111,24 @@ impl<'a> TryFrom<KeyAmalgamation<'a, key::PublicParts>>
Ok(match ka {
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Primary(),
+ bundle: KeyAmalgamationBundle::Primary(),
} => {
// Error out if the primary key does not have secret
// key material.
- let _ : &KeyBinding<key::SecretParts, key::PrimaryRole>
+ let _ : &KeyBundle<key::SecretParts, key::PrimaryRole>
= (&cert.primary).try_into()?;
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Primary(),
+ bundle: KeyAmalgamationBundle::Primary(),
}
}
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Subordinate(binding),
+ bundle: KeyAmalgamationBundle::Subordinate(bundle),
} =>
KeyAmalgamation {
cert,
- binding: KeyAmalgamationBinding::Subordinate(binding.try_into()?),
+ bundle: KeyAmalgamationBundle::Subordinate(bundle.try_into()?),
},
})
}
@@ -138,17 +138,17 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
pub(crate) fn new_primary(cert: &'a Cert) -> Self {
KeyAmalgamation {
cert: cert,
- binding: KeyAmalgamationBinding::Primary(),
+ bundle: KeyAmalgamationBundle::Primary(),
}
}
pub(crate) fn new_subordinate(
- cert: &'a Cert, binding: &'a KeyBinding<P, key::SubordinateRole>)
+ cert: &'a Cert, bundle: &'a KeyBundle<P, key::SubordinateRole>)
-> Self
{
KeyAmalgamation {
cert: cert,
- binding: KeyAmalgamationBinding::Subordinate(binding),
+ bundle: KeyAmalgamationBundle::Subordinate(bundle),
}
}
@@ -157,10 +157,10 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
where &'a Key<P, key::UnspecifiedRole>: From<&'a key::PublicKey>
{
match self {
- KeyAmalgamation { binding: KeyAmalgamationBinding::Primary(), .. } =>
+ KeyAmalgamation { bundle: KeyAmalgamationBundle::Primary(), .. } =>
self.cert.primary.key().into(),
- KeyAmalgamation { binding: KeyAmalgamationBinding::Subordinate(ref binding), .. } =>
- binding.key().into(),
+ KeyAmalgamation { bundle: KeyAmalgamationBundle::Subordinate(bundle), .. } =>
+ bundle.key().into(),
}
}
@@ -168,10 +168,10 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
fn generic_key(&self)
-> &'a Key<key::UnspecifiedParts, key::UnspecifiedRole> {
match self {
- KeyAmalgamation { binding: KeyAmalgamationBinding::Primary(), .. } =>
+ KeyAmalgamation { bundle: KeyAmalgamationBundle::Primary(), .. } =>
self.cert.primary.key().into(),
- KeyAmalgamation { binding: KeyAmalgamationBinding::Subordinate(ref binding), .. } =>
- binding.key().mark_parts_unspecified_ref().into(),
+ KeyAmalgamation { bundle: KeyAmalgamationBundle::Subordinate(bundle), .. } =>
+ bundle.key().mark_parts_unspecified_ref().into(),
}
}
@@ -202,16 +202,16 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
}
}
- /// Returns this key's binding.
- pub fn binding(&self) -> &'a KeyBinding<P, key::UnspecifiedRole>
- where &'a KeyBinding<P, key::UnspecifiedRole>:
- From<&'a KeyBinding<key::PublicParts, key::PrimaryRole>>
+ /// Returns this key's bundl