diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-04-14 21:41:31 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-04-14 21:42:15 +0200 |
commit | 979071beb4a3cb3d3ee06f1a7b0fd9d1df4adf1a (patch) | |
tree | 4344c63b1963c2e2ec496a6adc93cc8e6f650af2 /openpgp | |
parent | 4f3e229666559b51b94806d207968ad5d67d478c (diff) |
openpgp: Fix typos.
- Thanks to Justus and Wiktor for pointing them out.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/cert/amalgamation.rs | 30 | ||||
-rw-r--r-- | openpgp/src/cert/amalgamation/key.rs | 49 | ||||
-rw-r--r-- | openpgp/src/cert/amalgamation/key/iter.rs | 2 | ||||
-rw-r--r-- | openpgp/src/cert/bundle.rs | 8 |
4 files changed, 45 insertions, 44 deletions
diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs index aba252ee..3c6fbd52 100644 --- a/openpgp/src/cert/amalgamation.rs +++ b/openpgp/src/cert/amalgamation.rs @@ -47,7 +47,7 @@ //! flexible mechanism, called [`Policy`] objects, that allow users to //! implement this type of filtering: before a self signature is used, //! a policy object is queried to determine whether the `Signature` -//! should be rejected. If so, the it is skipped. +//! should be rejected. If so, then it is skipped. //! //! Second, we need an algorithm to determine the most appropriate //! self signature. Obvious non-candidate self signatures are self @@ -117,7 +117,7 @@ //! "[Intended Recipients]" subpacket, which more tightly binds the //! message to its context. //! -//! # [`ValidComponetAmalgamation`] +//! # [`ValidComponentAmalgamation`] //! //! Most operations need to query a `ComponentAmalgamation` for //! multiple pieces of information. Accidentally using a different @@ -132,12 +132,12 @@ //! calls clutters the code. //! //! To mitigate these issues, we have a separate data structure, -//! `ValidComponetAmalgamation`, which combines a +//! `ValidComponentAmalgamation`, which combines a //! `ComponetAmalgamation`, a `Policy` and a reference time. It //! implements methods that require a `Policy` and reference time, but //! instead of requiring the caller to pass them in, it uses the ones //! embedded in the data structure. Further, when the -//! `ValidComponetAmalgamation` constructor is passed `None` for the +//! `ValidComponentAmalgamation` constructor is passed `None` for the //! reference time, it eagerly stores the current time, and uses that //! for all operations. This approach elegantly solves all of the //! aforementioned problems. @@ -165,7 +165,7 @@ //! cert.userids() //! .map(|ua| { //! // Use auto deref to get the containing `&ComponentBundle`. -//! let b : &ComponentBundle<_> = &ua; +//! let b: &ComponentBundle<_> = &ua; //! b //! }) //! .collect::<Vec<&UserID>>(); @@ -210,15 +210,15 @@ //! [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html //! [`Cert`]: ../index.html //! [is supposed to]: https://tools.ietf.org/html/rfc4880#section-5.2.3.3 -//! [`ValidComponetAmalgamation`]: struct.ValidComponentAmalgamation.html +//! [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html //! [`std::iter::map`]: https://doc.rust-lang.org/std/iter/struct.Map.html //! [MD5 collisions]: https://en.wikipedia.org/wiki/MD5 //! [`Policy`]: ../../policy/index.html //! [streaming verifier]: ../../parse/stream.html //! [Intended Recipients]: https://www.ietf.org/id/draft-ietf-openpgp-rfc4880bis-09.html#name-intended-recipient-fingerpr //! [signature expirations]: https://tools.ietf.org/html/rfc4880#section-5.2.3.10 -//! [This discussion]: https://crypto.stackexchange.com/a/12138 //! [`Deref` trait]: https://doc.rust-lang.org/stable/std/ops/trait.Deref.html +//! [`ComponentAmalgamation::component`]: struct.ComponentAmalgamation.html#method.component use std::time; use std::time::SystemTime; use std::clone::Clone; @@ -273,14 +273,14 @@ pub mod key; /// /// - The certificate is valid. /// -/// # Example +/// # Examples /// /// ``` /// # extern crate sequoia_openpgp as openpgp; /// use openpgp::cert::prelude::*; /// use openpgp::policy::{Policy, StandardPolicy}; /// -/// const POLICY : &dyn Policy = &StandardPolicy::new(); +/// const POLICY: &dyn Policy = &StandardPolicy::new(); /// /// fn f(ua: UserIDAmalgamation) -> openpgp::Result<()> { /// let ua = ua.with_policy(POLICY, None)?; @@ -452,7 +452,7 @@ pub trait ValidAmalgamation<'a, C: 'a> /// // ... /// } /// # fn main() -> openpgp::Result<()> { - /// # let p : &dyn Policy = &StandardPolicy::new(); + /// # let p: &dyn Policy = &StandardPolicy::new(); /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -479,7 +479,7 @@ pub trait ValidAmalgamation<'a, C: 'a> /// // ... /// } /// # fn main() -> openpgp::Result<()> { - /// # let p : &dyn Policy = &StandardPolicy::new(); + /// # let p: &dyn Policy = &StandardPolicy::new(); /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -511,7 +511,7 @@ pub trait ValidAmalgamation<'a, C: 'a> /// // ... /// } /// # fn main() -> openpgp::Result<()> { - /// # let p : &dyn Policy = &StandardPolicy::new(); + /// # let p: &dyn Policy = &StandardPolicy::new(); /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -795,7 +795,7 @@ impl<'a, C> ComponentAmalgamation<'a, C> { /// .map(|ua| { /// // The following doesn't work: /// // - /// // let b : &ComponentBundle<_> = &ua; b + /// // let b: &ComponentBundle<_> = &ua; b /// // /// // Because ua's lifetime is this closure and autoderef /// // assigns `b` the same lifetime as `ua`. `bundle()`, @@ -984,9 +984,9 @@ impl<'a> UserAttributeAmalgamation<'a> { /// *certificate* is live. If you care about that, then you need to /// check it separately. /// -/// # Example +/// # Examples /// -/// Print out information about all non-revoked certificates. +/// Print out information about all non-revoked User IDs. /// /// ``` /// # extern crate sequoia_openpgp as openpgp; diff --git a/openpgp/src/cert/amalgamation/key.rs b/openpgp/src/cert/amalgamation/key.rs index 0ab7b570..905b6d21 100644 --- a/openpgp/src/cert/amalgamation/key.rs +++ b/openpgp/src/cert/amalgamation/key.rs @@ -9,15 +9,15 @@ //! components are bound to!), and, as a consequence, the associated //! meta-data is stored elsewhere. //! -//! Unfortunately, a primary Key's meta-data is stored not on a direct -//! key signature, which would be convenient as it is located at the -//! same place as a binding signature would be, but on the primary -//! User ID's binding signature. This requires some acrobatics on the -//! implementation side to realize the correct semantics. In -//! particular, a `Key` needs to memorize its role (i.e., whether it -//! is a primary key or a subkey) in order to know whether to consider -//! its own self signatures or the primary User ID's self signatures -//! when looking for its meta-data. +//! Unfortunately, a primary Key's meta-data is usually not stored on +//! a direct key signature, which would be convenient as it is located +//! at the same place as a binding signature would be, but on the +//! primary User ID's binding signature. This requires some +//! acrobatics on the implementation side to realize the correct +//! semantics. In particular, a `Key` needs to memorize its role +//! (i.e., whether it is a primary key or a subkey) in order to know +//! whether to consider its own self signatures or the primary User +//! ID's self signatures when looking for its meta-data. //! //! Ideally, a `KeyAmalgamation`'s role would be encoded in its type. //! This increases safety, and reduces the run-time overhead. @@ -58,8 +58,8 @@ //! cert.primary_key().bundle().role_as_subordinate(); //! //! // But this doesn't: -//! let ka : ErasedKeyAmalgamation<_> = cert.keys().nth(0).expect("primary key"); -//! let ka : openpgp::Result<SubordinateKeyAmalgamation<key::PublicParts>> = ka.try_into(); +//! let ka: ErasedKeyAmalgamation<_> = cert.keys().nth(0).expect("primary key"); +//! let ka: openpgp::Result<SubordinateKeyAmalgamation<key::PublicParts>> = ka.try_into(); //! assert!(ka.is_err()); //! ``` //! @@ -245,6 +245,7 @@ //! [`ErasedKeyAmalgamation`]: ../type.ErasedKeyAmalgamation.html //! [`KeyRole::UnspecifiedRole`]: ../../../packet/key/trait.KeyRole.html //! [`Policy` discussion]: ../index.html +//! [This discussion]: https://crypto.stackexchange.com/a/12138 use std::time; use std::time::SystemTime; use std::ops::Deref; @@ -315,12 +316,12 @@ pub trait PrimaryKey<'a, P, R> /// # .generate()?; /// # let fpr = cert.fingerprint(); /// // This works if the type is concrete: - /// let ka : PrimaryKeyAmalgamation<_> = cert.primary_key(); + /// let ka: PrimaryKeyAmalgamation<_> = cert.primary_key(); /// assert!(ka.primary()); /// /// // Or if it has been erased: /// for (i, ka) in cert.keys().enumerate() { - /// let ka : ErasedKeyAmalgamation<_> = ka; + /// let ka: ErasedKeyAmalgamation<_> = ka; /// if i == 0 { /// // The primary key is always the first key returned by /// // `Cert::keys`. @@ -370,7 +371,7 @@ pub trait PrimaryKey<'a, P, R> /// # .generate()?; /// # let fpr = cert.fingerprint(); /// for ka in cert.keys() { -/// let ka : ErasedKeyAmalgamation<_> = ka; +/// let ka: ErasedKeyAmalgamation<_> = ka; /// } /// # Ok(()) /// # } @@ -389,7 +390,7 @@ pub trait PrimaryKey<'a, P, R> /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; /// # let fpr = cert.fingerprint(); -/// let ka : PrimaryKeyAmalgamation<_> = cert.primary_key(); +/// let ka: PrimaryKeyAmalgamation<_> = cert.primary_key(); /// # Ok(()) /// # } /// ``` @@ -409,12 +410,12 @@ pub trait PrimaryKey<'a, P, R> /// # let fpr = cert.fingerprint(); /// // We can skip the primary key (it's always first): /// for ka in cert.keys().skip(1) { -/// let ka : ErasedKeyAmalgamation<_> = ka; +/// let ka: ErasedKeyAmalgamation<_> = ka; /// } /// /// // Or use `subkeys`, which returns a more accurate type: /// for ka in cert.keys().subkeys() { -/// let ka : SubordinateKeyAmalgamation<_> = ka; +/// let ka: SubordinateKeyAmalgamation<_> = ka; /// } /// # Ok(()) /// # } @@ -817,7 +818,7 @@ impl<'a, P, R, R2> KeyAmalgamation<'a, P, R, R2> /// [`KeyAmalgamation`]: a `ValidKeyAmalgamation` combines a /// `KeyAmalgamation`, a [`Policy`], and a reference time. This /// allows it to implement the [`ValidAmalgamation`] trait, which -/// provides methods like [`binding_signature`] that require a +/// provides methods like [`ValidAmalgamation::binding_signature`] that require a /// `Policy` and a reference time. Although `KeyAmalgamation` could /// implement these methods by requiring that the caller explicitly /// pass them in, embedding them in the `ValidKeyAmalgamation` helps @@ -899,7 +900,7 @@ impl<'a, P, R, R2> KeyAmalgamation<'a, P, R, R2> /// [`KeyAmalgamation`]: struct.KeyAmalgamation.html /// [`Policy`]: ../../../policy/index.html /// [`ValidAmalgamation`]: ../trait.ValidAmalgamation.html -/// [`binding_signature`]: ../trait.ValidAmalgamation.html#method.binding_signature +/// [`ValidAmalgamation::binding_signature`]: ../trait.ValidAmalgamation.html#method.binding_signature /// [`ValidateAmalgamation::with_policy`]: ../trait.ValidateAmalgamation.html#tymethod.with_policy /// [`KeyAmalgamationIter`]: struct.KeyAmalgamationIter.html #[derive(Debug, Clone)] @@ -1497,7 +1498,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # use openpgp::policy::{Policy, StandardPolicy}; /// # /// # fn main() -> openpgp::Result<()> { - /// # let p : &dyn Policy = &StandardPolicy::new(); + /// # let p: &dyn Policy = &StandardPolicy::new(); /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -1790,8 +1791,8 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// /// // OpenPGP Timestamps have a one-second resolution. Since we /// // want to round trip the time, round it down. - /// let now : Timestamp = time::SystemTime::now().try_into()?; - /// let now : time::SystemTime = now.try_into()?; + /// let now: Timestamp = time::SystemTime::now().try_into()?; + /// let now: time::SystemTime = now.try_into()?; /// /// let a_week = time::Duration::from_secs(7 * 24 * 60 * 60); /// let a_week_later = now + a_week; @@ -1841,8 +1842,8 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// /// // OpenPGP Timestamps have a one-second resolution. Since we /// // want to round trip the time, round it down. - /// let now : Timestamp = time::SystemTime::now().try_into()?; - /// let now : time::SystemTime = now.try_into()?; + /// let now: Timestamp = time::SystemTime::now().try_into()?; + /// let now: time::SystemTime = now.try_into()?; // /// let a_week = time::Duration::from_secs(7 * 24 * 60 * 60); /// let a_week_later = now + a_week; diff --git a/openpgp/src/cert/amalgamation/key/iter.rs b/openpgp/src/cert/amalgamation/key/iter.rs index dd667e6b..4911fbcd 100644 --- a/openpgp/src/cert/amalgamation/key/iter.rs +++ b/openpgp/src/cert/amalgamation/key/iter.rs @@ -544,7 +544,7 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// // /// // Note: using the combinator interface (instead of checking /// // the individual keys) makes it harder to report exactly why no -/// // was usable. +/// // key was usable. /// for ka in cert.keys() /// // Not revoked. /// .revoked(false) diff --git a/openpgp/src/cert/bundle.rs b/openpgp/src/cert/bundle.rs index 37534400..54540831 100644 --- a/openpgp/src/cert/bundle.rs +++ b/openpgp/src/cert/bundle.rs @@ -321,7 +321,7 @@ impl<C> ComponentBundle<C> { } } - /// The component's self-signatures. + /// Returns the component's self-signatures. /// /// The signatures are validated, and they are sorted by their /// creation time, most recent first. @@ -350,7 +350,7 @@ impl<C> ComponentBundle<C> { &self.self_signatures } - /// The component's third-party certifications. + /// Returns the component's third-party certifications. /// /// The signatures are *not* validated. They are sorted by their /// creation time, most recent first. @@ -379,7 +379,7 @@ impl<C> ComponentBundle<C> { &self.certifications } - /// The component's revocations that were issued by the + /// Returns the component's revocations that were issued by the /// certificate holder. /// /// The revocations are validated, and they are sorted by their @@ -409,7 +409,7 @@ impl<C> ComponentBundle<C> { &self.self_revocations } - /// The component's revocations that were issued by other + /// Returns the component's revocations that were issued by other /// certificates. /// /// The revocations are *not* validated. They are sorted by their |