From e5746684e84377dd8828f6a5a8ab4c0eec73c3ec Mon Sep 17 00:00:00 2001 From: Nora Widdecke Date: Mon, 23 Aug 2021 16:55:26 +0200 Subject: Convert markdown to intra-doc links. - Apply cargo intraconv. --- openpgp/src/cert.rs | 125 +++++----- openpgp/src/cert/amalgamation.rs | 65 ++--- openpgp/src/cert/amalgamation/iter.rs | 25 +- openpgp/src/cert/amalgamation/key.rs | 84 +++---- openpgp/src/cert/amalgamation/key/iter.rs | 82 +++---- openpgp/src/cert/bindings.rs | 2 +- openpgp/src/cert/builder.rs | 42 ++-- openpgp/src/cert/bundle.rs | 43 ++-- openpgp/src/cert/parser/mod.rs | 16 +- openpgp/src/cert/revoke.rs | 12 +- openpgp/src/crypto/asymmetric.rs | 14 +- openpgp/src/crypto/backend/cng/hash.rs | 2 +- openpgp/src/crypto/backend/nettle.rs | 2 +- openpgp/src/crypto/backend/nettle/asymmetric.rs | 6 +- openpgp/src/crypto/backend/nettle/hash.rs | 2 +- openpgp/src/crypto/hash.rs | 16 +- openpgp/src/crypto/mem.rs | 4 +- openpgp/src/crypto/mod.rs | 16 +- openpgp/src/crypto/mpi.rs | 18 +- openpgp/src/crypto/s2k.rs | 9 +- openpgp/src/fingerprint.rs | 6 +- openpgp/src/keyhandle.rs | 4 +- openpgp/src/keyid.rs | 4 +- openpgp/src/message/mod.rs | 8 +- openpgp/src/packet/aed.rs | 6 +- openpgp/src/packet/container.rs | 30 +-- openpgp/src/packet/header/ctb.rs | 8 +- openpgp/src/packet/header/mod.rs | 10 +- openpgp/src/packet/key.rs | 161 ++++++------- openpgp/src/packet/mod.rs | 146 +++++------ openpgp/src/packet/signature.rs | 306 ++++++++++++------------ openpgp/src/packet/signature/subpacket.rs | 171 +++++++------ openpgp/src/packet/skesk.rs | 18 +- openpgp/src/packet/tag.rs | 2 +- openpgp/src/packet/unknown.rs | 2 +- openpgp/src/packet/user_attribute.rs | 4 +- openpgp/src/packet/userid.rs | 26 +- openpgp/src/packet_pile.rs | 2 +- openpgp/src/parse.rs | 131 +++++----- openpgp/src/parse/hashed_reader.rs | 2 +- openpgp/src/parse/map.rs | 7 +- openpgp/src/parse/packet_parser_builder.rs | 16 +- openpgp/src/parse/packet_pile_parser.rs | 9 +- openpgp/src/parse/stream.rs | 116 +++------ openpgp/src/policy.rs | 34 ++- openpgp/src/regex/mod.rs | 63 +++-- openpgp/src/seal.rs | 2 +- openpgp/src/serialize.rs | 72 +++--- openpgp/src/serialize/cert.rs | 10 +- openpgp/src/serialize/stream.rs | 86 +++---- openpgp/src/serialize/stream/padding.rs | 14 +- openpgp/src/types/compression_level.rs | 3 +- openpgp/src/types/features.rs | 2 +- openpgp/src/types/key_flags.rs | 2 +- openpgp/src/types/mod.rs | 14 +- openpgp/src/types/revocation_key.rs | 4 +- openpgp/src/types/server_preferences.rs | 6 +- openpgp/src/types/timestamp.rs | 8 +- 58 files changed, 924 insertions(+), 1176 deletions(-) (limited to 'openpgp') diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index 168034e8..15afacac 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -113,19 +113,19 @@ //! [`ComponentAmalgamation`]: amalgamation::ComponentAmalgamation //! [`Parser` implementation]: struct.Cert.html#impl-Parse%3C%27a%2C%20Cert%3E //! [`Serialize` implementation]: struct.Cert.html#impl-Serialize%3C%27a%2C%20Cert%3E -//! [`UserID::certify`]: ../packet/struct.UserID.html#method.certify -//! [`UserAttribute::certify`]: ../packet/user_attribute/struct.UserAttribute.html#method.certify -//! [`KeyAmalgamation`]: amalgamation/key/index.html -//! [`UserID::bind`]: ../packet/struct.UserID.html#method.bind -//! [`UserAttribute::bind`]: ../packet/user_attribute/struct.UserAttribute.html#method.bind -//! [`Key::bind`]: ../packet/enum.Key.html#method.bind -//! [`Signature::verify_direct_key`]: ../packet/enum.Signature.html#method.verify_direct_key -//! [`Signature::verify_userid_binding`]: ../packet/enum.Signature.html#method.verify_userid_binding -//! [`Signature::verify_user_attribute_binding`]: ../packet/enum.Signature.html#method.verify_user_attribute_binding +//! [`UserID::certify`]: super::packet::UserID::certify() +//! [`UserAttribute::certify`]: super::packet::user_attribute::UserAttribute::certify() +//! [`KeyAmalgamation`]: amalgamation::key +//! [`UserID::bind`]: super::packet::UserID::bind() +//! [`UserAttribute::bind`]: super::packet::user_attribute::UserAttribute::bind() +//! [`Key::bind`]: super::packet::Key::bind() +//! [`Signature::verify_direct_key`]: super::packet::Signature::verify_direct_key() +//! [`Signature::verify_userid_binding`]: super::packet::Signature::verify_userid_binding() +//! [`Signature::verify_user_attribute_binding`]: super::packet::Signature::verify_user_attribute_binding() //! [`ValidAmalgamation::revocation_keys`]: amalgamation::ValidAmalgamation::revocation_keys -//! [`Signature::verify_primary_key_revocation`]: ../packet/enum.Signature.html#method.verify_primary_key_revocation -//! [`Signature::verify_userid_revocation`]: ../packet/enum.Signature.html#method.verify_userid_revocation -//! [`Signature::verify_user_attribute_revocation`]: ../packet/enum.Signature.html#method.verify_user_attribute_revocation +//! [`Signature::verify_primary_key_revocation`]: super::packet::Signature::verify_primary_key_revocation() +//! [`Signature::verify_userid_revocation`]: super::packet::Signature::verify_userid_revocation() +//! [`Signature::verify_user_attribute_revocation`]: super::packet::Signature::verify_user_attribute_revocation() use std::io; use std::collections::btree_map::BTreeMap; @@ -498,9 +498,9 @@ pub trait Preferences<'a>: seal::Sealed { /// signatures, and third-party revocations, as well as useful methods. /// /// [TPK and TSK data structures]: https://tools.ietf.org/html/rfc4880#section-11 -/// [`Key`]: ../packet/enum.Key.html -/// [`UserID`]: ../packet/struct.UserID.html -/// [`UserAttribute`]: ../packet/user_attribute/struct.UserAttribute.html +/// [`Key`]: super::packet::Key +/// [`UserID`]: super::packet::UserID +/// [`UserAttribute`]: super::packet::user_attribute::UserAttribute /// /// `Cert`s are canonicalized in the sense that their `Component`s are /// deduplicated, and their signatures and revocations are @@ -509,7 +509,7 @@ pub trait Preferences<'a>: seal::Sealed { /// signatures. These are returned as usual by, e.g., /// [`Cert::userids`]. /// -/// [`Cert::userids`]: struct.Cert.html#method.userids +/// [`Cert::userids`]: Cert::userids() /// /// Keys are deduplicated by comparing their public bits using /// [`Key::public_cmp`]. If two keys are considered equal, and only @@ -521,7 +521,7 @@ pub trait Preferences<'a>: seal::Sealed { /// secret key material, it is essential to first strip the secret key /// material from copies that came from an untrusted source. /// -/// [`Key::public_cmp`]: ../packet/enum.Key.html#method.public_cmp +/// [`Key::public_cmp`]: super::packet::Key::public_cmp() /// /// Signatures are deduplicated using [their `Eq` implementation], /// which compares the data that is hashed and the MPIs. That is, it @@ -532,7 +532,7 @@ pub trait Preferences<'a>: seal::Sealed { /// This policy prevents an attacker from flooding a certificate with /// valid signatures that only differ in their unhashed data. /// -/// [their `Eq` implementation]: ../packet/enum.Signature.html#a-note-on-equality +/// [their `Eq` implementation]: super::packet::Signature#a-note-on-equality /// [the unhashed data]: https://tools.ietf.org/html/rfc4880#section-5.2.3 /// /// Self signatures and self revocations are checked for validity by @@ -549,10 +549,10 @@ pub trait Preferences<'a>: seal::Sealed { /// verification method, e.g., [`Signature::verify_userid_binding`] /// or [`Signature::verify_userid_revocation`]. /// -/// [`Policy`]: ../policy/index.html -/// [digest prefix]: ../packet/signature/struct.Signature4.html#method.digest_prefix -/// [`Signature::verify_userid_binding`]: ../packet/enum.Signature.html#method.verify_userid_binding -/// [`Signature::verify_userid_revocation`]: ../packet/enum.Signature.html#method.verify_userid_revocation +/// [`Policy`]: super::policy +/// [digest prefix]: super::packet::signature::Signature4::digest_prefix() +/// [`Signature::verify_userid_binding`]: super::packet::Signature::verify_userid_binding() +/// [`Signature::verify_userid_revocation`]: super::packet::Signature::verify_userid_revocation() /// /// If a signature or a revocation is not valid, /// we check to see whether it is simply out of place (i.e., belongs @@ -560,7 +560,7 @@ pub trait Preferences<'a>: seal::Sealed { /// is added to a list of bad signatures. These can be retrieved /// using [`Cert::bad_signatures`]. /// -/// [`Cert::bad_signatures`]: struct.Cert.html#method.bad_signatures +/// [`Cert::bad_signatures`]: Cert::bad_signatures() /// /// Signatures and revocations are sorted so that the newest signature /// comes first. Components are sorted, but in an undefined manner @@ -576,14 +576,13 @@ pub trait Preferences<'a>: seal::Sealed { /// key material, you need to serialize the object returned by /// [`Cert::as_tsk()`]. /// -/// [`Cert::as_tsk()`]: #method.as_tsk /// /// Secret key material may be protected with a password. In such /// cases, it needs to be decrypted before it can be used to decrypt /// data or generate a signature. Refer to [`Key::decrypt_secret`] /// for details. /// -/// [`Key::decrypt_secret`]: ../packet/enum.Key.html#method.decrypt_secret +/// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() /// /// # Filtering Certificates /// @@ -591,9 +590,9 @@ pub trait Preferences<'a>: seal::Sealed { /// can be done with [`Cert::retain_userids`], /// [`Cert::retain_user_attributes`], and [`Cert::retain_subkeys`]. /// -/// [`Cert::retain_userids`]: #method.retain_userids -/// [`Cert::retain_user_attributes`]: #method.retain_user_attributes -/// [`Cert::retain_subkeys`]: #method.retain_subkeys +/// [`Cert::retain_userids`]: Cert::retain_userids() +/// [`Cert::retain_user_attributes`]: Cert::retain_user_attributes() +/// [`Cert::retain_subkeys`]: Cert::retain_subkeys() /// /// If you need even more control, iterate over all components, clone /// what you want to keep, and then reassemble the certificate. The @@ -791,8 +790,8 @@ impl Cert { /// to decrypt data or generate a signature. Refer to /// [`Key::decrypt_secret`] for details. /// - /// [`Cert::keys`]: #method.keys - /// [`Key::decrypt_secret`]: ../packet/enum.Key.html#method.decrypt_secret + /// [`Cert::keys`]: Cert::keys() + /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() /// /// # Examples /// @@ -827,7 +826,6 @@ impl Cert { /// possible to turn a `Cert` into a `ValidCert` at time `t`, it /// may still be considered revoked at time `t`. /// - /// [`ValidCert`]: struct.ValidCert.html /// /// A certificate is considered revoked at time `t` if: /// @@ -838,12 +836,12 @@ impl Cert { /// - There is a valid [hard revocation] (even if it is not live /// at time `t`, and even if there is a newer self signature). /// - /// [hard revocation]: ../types/enum.RevocationType.html#variant.Hard + /// [hard revocation]: super::types::RevocationType::Hard /// /// Note: certificates and subkeys have different revocation /// criteria from [User IDs and User Attributes]. /// - /// [User IDs and User Attributes]: amalgamation/struct.ComponentAmalgamation.html#method.revocation_status + /// [User IDs and User Attributes]: amalgamation::ComponentAmalgamation::revocation_status() /// /// # Examples /// @@ -899,15 +897,11 @@ impl Cert { /// certificate. To use the revocation certificate, merge it into /// the certificate using [`Cert::insert_packets`]. /// - /// [`CertRevocationBuilder`]: struct.CertRevocationBuilder.html /// /// If you want to revoke an individual component, use /// [`SubkeyRevocationBuilder`], [`UserIDRevocationBuilder`], or /// [`UserAttributeRevocationBuilder`], as appropriate. /// - /// [`SubkeyRevocationBuilder`]: struct.SubkeyRevocationBuilder.html - /// [`UserIDRevocationBuilder`]: struct.UserIDRevocationBuilder.html - /// [`UserAttributeRevocationBuilder`]: struct.UserAttributeRevocationBuilder.html /// /// # Examples /// @@ -1140,9 +1134,9 @@ impl Cert { /// can be used to decrypt data or generate a signature. Refer to /// [`Key::decrypt_secret`] for details. /// - /// [`Cert::primary_key`]: #method.primary_key - /// [`KeyAmalgamationIter::subkeys`]: amalgamation/key/struct.KeyAmalgamationIter.html#method.subkeys - /// [`Key::decrypt_secret`]: ../packet/enum.Key.html#method.decrypt_secret + /// [`Cert::primary_key`]: Cert::primary_key() + /// [`KeyAmalgamationIter::subkeys`]: amalgamation::key::KeyAmalgamationIter::subkeys() + /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() /// /// # Examples /// @@ -1235,7 +1229,7 @@ impl Cert { /// check; third party-signatures and third-party revocations may /// be invalid and must still be checked for validity before use. /// - /// [digest prefix]: packet/signature/struct.Signature4.html#method.digest_prefix + /// [digest prefix]: packet::signature::Signature4::digest_prefix() /// /// # Examples /// @@ -1335,9 +1329,9 @@ impl Cert { /// appropriate. This means that **if you serialize the resulting /// packets, the secret key material will be serialized too**. /// - /// [`TSK`]: serialize/struct.TSK.html - /// [`SecretKey`]: enum.Packet.html#variant.SecretKey - /// [`SecretSubkey`]: enum.Packet.html#variant.SecretSubkey + /// [`TSK`]: serialize::TSK + /// [`SecretKey`]: Packet::SecretKey + /// [`SecretSubkey`]: Packet::SecretSubkey /// /// # Examples /// @@ -2129,7 +2123,7 @@ impl Cert { /// [`Cert::insert_packets`], which prefers keys in the packets that /// are being merged into the certificate. /// - /// [`Cert::insert_packets`]: #method.insert_packets + /// [`Cert::insert_packets`]: Cert::insert_packets() /// /// This function is appropriate to merge certificate material /// from untrusted sources like keyservers. If `other` contains @@ -2137,7 +2131,7 @@ impl Cert { /// [`Cert::merge_public_and_secret`] on how to merge certificates /// containing secret key material from trusted sources. /// - /// [`Cert::merge_public_and_secret`]: #method.merge_public_and_secret + /// [`Cert::merge_public_and_secret`]: Cert::merge_public_and_secret() /// /// # Examples /// @@ -2171,7 +2165,7 @@ impl Cert { /// [`Cert::insert_packets`], which prefers keys in the packets that /// are being merged into the certificate. /// - /// [`Cert::insert_packets`]: #method.insert_packets + /// [`Cert::insert_packets`]: Cert::insert_packets() /// /// It is important to only merge key material from trusted /// sources using this function, because it may be used to import @@ -2296,7 +2290,7 @@ impl Cert { /// the unhashed subpacket area can be updated. /// /// [Known packets that don't belong in a TPK or TSK]: https://tools.ietf.org/html/rfc4880#section-11 - /// [unknown components]: #method.unknowns + /// [unknown components]: Cert::unknowns() /// /// # Examples /// @@ -2655,8 +2649,7 @@ impl Cert { /// flags (see [`ValidKeyAmalgamation::key_flags`]). Removing a /// userid may inadvertently change this information. /// - /// [`Preferences`]: trait.Preferences.html - /// [`ValidKeyAmalgamation::key_flags`]: amalgamation/key/struct.ValidKeyAmalgamation.html#method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: amalgamation::key::ValidKeyAmalgamation::key_flags() /// /// # Examples /// @@ -2807,10 +2800,10 @@ impl Cert { /// is alive (see [`ValidCert::alive`]) or revoked (see /// [`ValidCert::revoked`]). /// - /// [`ValidCert`]: cert/struct.ValidCert.html - /// [`ValidateAmalgamation`]: cert/amalgamation/trait.ValidateAmalgamation.html - /// [`ValidCert::alive`]: cert/struct.ValidCert.html#method.alive - /// [`ValidCert::revoked`]: cert/struct.ValidCert.html#method.revoked + /// [`ValidCert`]: cert::ValidCert + /// [`ValidateAmalgamation`]: cert::amalgamation::ValidateAmalgamation + /// [`ValidCert::alive`]: cert::ValidCert::alive() + /// [`ValidCert::revoked`]: cert::ValidCert::revoked() /// /// # Examples /// @@ -2942,8 +2935,7 @@ impl From for Vec { /// This structure is created by the `into_iter` method on [`Cert`] /// (provided by the [`IntoIterator`] trait). /// -/// [`Cert`]: struct.Cert.html -/// [`IntoIterator`]: https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html +/// [`IntoIterator`]: std::iter::IntoIterator // We can't use a generic type, and due to the use of closures, we // can't write down the concrete type. So, just use a Box. pub struct IntoIter(Box + Send + Sync>); @@ -2988,9 +2980,8 @@ impl IntoIterator for Cert /// the certificate or any component is live. If you care about those /// things, then you need to check them separately. /// -/// [`Cert`]: struct.Cert.html -/// [`Policy`]: ../policy/index.html -/// [`Cert::with_policy`]: struct.Cert.html#method.with_policy +/// [`Policy`]: super::policy +/// [`Cert::with_policy`]: Cert::with_policy() /// /// # Examples /// @@ -3194,12 +3185,12 @@ impl<'a> ValidCert<'a> { /// - There is a valid [hard revocation] (even if it is not live /// at time `t`, and even if there is a newer self signature). /// - /// [hard revocation]: ../types/enum.RevocationType.html#variant.Hard + /// [hard revocation]: super::types::RevocationType::Hard /// /// Note: certificates and subkeys have different revocation /// criteria from [User IDs and User Attributes]. /// - /// [User IDs and User Attributes]: amalgamation/struct.ComponentAmalgamation.html#userid_revocation_status + /// [User IDs and User Attributes]: amalgamation::ComponentAmalgamation#userid_revocation_status /// /// # Examples /// @@ -3242,8 +3233,8 @@ impl<'a> ValidCert<'a> { /// binding signature], however, that does not mean that the /// [primary key is necessarily alive]. /// - /// [a live binding signature]: amalgamation/trait.ValidateAmalgamation.html - /// [primary key is necessarily alive]: amalgamation/key/struct.ValidKeyAmalgamation.html#method.alive + /// [a live binding signature]: amalgamation::ValidateAmalgamation + /// [primary key is necessarily alive]: amalgamation::key::ValidKeyAmalgamation::alive() /// /// # Examples /// @@ -3290,7 +3281,7 @@ impl<'a> ValidCert<'a> { /// can be used to decrypt data or generate a signature. Refer to /// [`Key::decrypt_secret`] for details. /// - /// [`Key::decrypt_secret`]: ../packet/enum.Key.html#method.decrypt_secret + /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() /// /// # Examples /// @@ -3335,8 +3326,8 @@ impl<'a> ValidCert<'a> { /// can be used to decrypt data or generate a signature. Refer to /// [`Key::decrypt_secret`] for details. /// - /// [`ValidKeyAmalgamationIter::subkeys`]: amalgamation/key/struct.ValidKeyAmalgamationIter.html#method.subkeys - /// [`Key::decrypt_secret`]: ../packet/enum.Key.html#method.decrypt_secret + /// [`ValidKeyAmalgamationIter::subkeys`]: amalgamation::key::ValidKeyAmalgamationIter::subkeys() + /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() /// /// # Examples /// @@ -3524,7 +3515,7 @@ impl<'a> ValidCert<'a> { /// the primary User ID. See the documentation of /// [`ValidCert::primary_userid`] for details. /// - /// [`ValidCert::primary_userid`]: #method.primary_userid + /// [`ValidCert::primary_userid`]: IntoIter::primary_userid() /// /// # Examples /// diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs index a12c7b9b..b721acb6 100644 --- a/openpgp/src/cert/amalgamation.rs +++ b/openpgp/src/cert/amalgamation.rs @@ -209,20 +209,18 @@ //! # Ok(()) } //! ``` //! -//! [`ComponentBundle`]: ../bundle/index.html -//! [`Signature`]: ../../packet/signature/index.html -//! [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html -//! [`Cert`]: ../index.html +//! [`ComponentBundle`]: super::bundle +//! [`Signature`]: super::super::packet::signature +//! [`Cert`]: super //! [is supposed to]: https://tools.ietf.org/html/rfc4880#section-5.2.3.3 -//! [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html -//! [`std::iter::map`]: https://doc.rust-lang.org/std/iter/struct.Map.html +//! [`std::iter::map`]: std::iter::Map //! [MD5 collisions]: https://en.wikipedia.org/wiki/MD5 -//! [`Policy`]: ../../policy/index.html +//! [`Policy`]: super::super::policy //! [streaming verifier]: ../../parse/stream.html //! [Intended Recipients]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#name-intended-recipient-fingerpr //! [signature expirations]: https://tools.ietf.org/html/rfc4880#section-5.2.3.10 -//! [`Deref` trait]: https://doc.rust-lang.org/stable/std/ops/trait.Deref.html -//! [`ComponentAmalgamation::component`]: struct.ComponentAmalgamation.html#method.component +//! [`Deref` trait]: std::ops::Deref +//! [`ComponentAmalgamation::component`]: ComponentAmalgamation::component() use std::time; use std::time::SystemTime; use std::clone::Clone; @@ -317,18 +315,12 @@ pub mod key; /// # } /// ``` /// -/// [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html -/// [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html -/// [`KeyAmalgamation`]: struct.KeyAmalgamation.html -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html pub trait ValidateAmalgamation<'a, C: 'a>: seal::Sealed { /// The type returned by `with_policy`. /// /// This is either a [`ValidComponentAmalgamation`] or /// a [`ValidKeyAmalgamation`]. /// - /// [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html - /// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html type V; /// Uses the specified `Policy` and reference time with the amalgamation. @@ -689,15 +681,13 @@ pub trait ValidAmalgamation<'a, C: 'a>: seal::Sealed /// # } /// ``` /// -/// [`Cert`]: ../struct.Cert.html -/// [`Cert::userids`]: ../struct.Cert.html#method.userids -/// [`Cert::primary_userid`]: ../struct.Cert.html#method.primary_userid -/// [`Cert::user_attributes`]: ../struct.Cert.html#method.user_attributes -/// [`Cert::unknowns`]: ../struct.Cert.html#method.unknown -/// [`ValidateAmalgamation`]: trait.ValidateAmalgamation.html -/// [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html -/// [`ComponentAmalgamation::with_policy`]: trait.ValidateAmalgamation.html#method.with_policy -/// [See the module's documentation]: index.html +/// [`Cert`]: super::Cert +/// [`Cert::userids`]: super::Cert::userids() +/// [`Cert::primary_userid`]: super::Cert::primary_userid() +/// [`Cert::user_attributes`]: super::Cert::user_attributes() +/// [`Cert::unknowns`]: super::Cert::unknown() +/// [`ComponentAmalgamation::with_policy`]: ValidateAmalgamation::with_policy() +/// [See the module's documentation]: self #[derive(Debug, PartialEq)] pub struct ComponentAmalgamation<'a, C> { cert: &'a Cert, @@ -709,14 +699,12 @@ assert_send_and_sync!(ComponentAmalgamation<'_, C> where C); /// /// A specialized version of [`ComponentAmalgamation`]. /// -/// [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html pub type UserIDAmalgamation<'a> = ComponentAmalgamation<'a, UserID>; /// A User Attribute and its associated data. /// /// A specialized version of [`ComponentAmalgamation`]. /// -/// [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html pub type UserAttributeAmalgamation<'a> = ComponentAmalgamation<'a, UserAttribute>; @@ -724,7 +712,6 @@ pub type UserAttributeAmalgamation<'a> /// /// A specialized version of [`ComponentAmalgamation`]. /// -/// [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html pub type UnknownComponentAmalgamation<'a> = ComponentAmalgamation<'a, Unknown>; @@ -802,7 +789,7 @@ impl<'a, C> ComponentAmalgamation<'a, C> { /// lifetime, which is helpful when returning the reference from a /// function. [See the module's documentation] for more details. /// - /// [See the module's documentation]: index.html + /// [See the module's documentation]: self /// /// # Examples /// @@ -844,7 +831,7 @@ impl<'a, C> ComponentAmalgamation<'a, C> { /// reference from a function. [See the module's documentation] /// for more details. /// - /// [See the module's documentation]: index.html + /// [See the module's documentation]: self pub fn component(&self) -> &'a C { self.bundle().component() } @@ -932,7 +919,7 @@ impl<'a> UserIDAmalgamation<'a> { /// reference from a function. [See the module's documentation] /// for more details. /// - /// [See the module's documentation]: index.html + /// [See the module's documentation]: self pub fn userid(&self) -> &'a UserID { self.component() } @@ -1030,7 +1017,7 @@ impl<'a> UserAttributeAmalgamation<'a> { /// returning the reference from a function. [See the module's /// documentation] for more details. /// - /// [See the module's documentation]: index.html + /// [See the module's documentation]: self pub fn user_attribute(&self) -> &'a UserAttribute { self.component() } @@ -1053,7 +1040,7 @@ impl<'a> UserAttributeAmalgamation<'a> { /// /// See [`UserIDAmalgamation::attest_certifications#examples`]. /// - /// [`UserIDAmalgamation::attest_certifications#examples`]: type.UserIDAmalgamation.html#examples + /// [`UserIDAmalgamation::attest_certifications#examples`]: UserIDAmalgamation#examples // The explicit link works around a bug in rustdoc. pub fn attest_certifications(&self, policy: &dyn Policy, @@ -1244,11 +1231,7 @@ where C: IntoIterator, /// # Ok(()) } /// ``` /// -/// [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html -/// [`Policy`]: ../../policy/index.html -/// [`ValidAmalgamation`]: trait.ValidAmalgamation.html -/// [`ValidateAmalgamation::with_policy`]: trait.ValidateAmalgamation.html#tymethod.with_policy -/// [`ComponentAmalgamationIter`]: struct.ComponentAmalgamationIter.html +/// [`Policy`]: super::super::policy #[derive(Debug)] pub struct ValidComponentAmalgamation<'a, C> { ca: ComponentAmalgamation<'a, C>, @@ -1262,7 +1245,6 @@ assert_send_and_sync!(ValidComponentAmalgamation<'_, C> where C); /// /// A specialized version of [`ValidComponentAmalgamation`]. /// -/// [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html pub type ValidUserIDAmalgamation<'a> = ValidComponentAmalgamation<'a, UserID>; impl<'a> ValidUserIDAmalgamation<'a> { @@ -1324,7 +1306,7 @@ impl<'a> ValidUserIDAmalgamation<'a> { /// [`ValidUserIDAmalgamation::attested_certifications`] to /// iterate over all attested certifications. /// - /// [`ValidUserIDAmalgamation::attested_certifications`]: #method.attested_certifications + /// [`ValidUserIDAmalgamation::attested_certifications`]: ValidUserIDAmalgamation::attested_certifications() // The explicit link works around a bug in rustdoc. pub fn attestation_key_signatures(&'a self) -> impl Iterator + Send + Sync @@ -1433,7 +1415,6 @@ impl<'a> ValidUserIDAmalgamation<'a> { /// /// A specialized version of [`ValidComponentAmalgamation`]. /// -/// [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html pub type ValidUserAttributeAmalgamation<'a> = ValidComponentAmalgamation<'a, UserAttribute>; @@ -1496,7 +1477,7 @@ impl<'a> ValidUserAttributeAmalgamation<'a> { /// [`ValidUserAttributeAmalgamation::attested_certifications`] to /// iterate over all attested certifications. /// - /// [`ValidUserAttributeAmalgamation::attested_certifications`]: #method.attested_certifications + /// [`ValidUserAttributeAmalgamation::attested_certifications`]: ValidUserAttributeAmalgamation::attested_certifications() // The explicit link works around a bug in rustdoc. pub fn attestation_key_signatures(&'a self) -> impl Iterator + Send + Sync @@ -1545,7 +1526,7 @@ impl<'a> ValidUserAttributeAmalgamation<'a> { /// /// See [`ValidUserIDAmalgamation::attest_certifications#examples`]. /// - /// [`ValidUserIDAmalgamation::attest_certifications#examples`]: type.ValidUserIDAmalgamation.html#examples + /// [`ValidUserIDAmalgamation::attest_certifications#examples`]: ValidUserIDAmalgamation#examples // The explicit link works around a bug in rustdoc. pub fn attest_certifications(&self, primary_signer: &mut dyn Signer, diff --git a/openpgp/src/cert/amalgamation/iter.rs b/openpgp/src/cert/amalgamation/iter.rs index 9e40abde..a677aa37 100644 --- a/openpgp/src/cert/amalgamation/iter.rs +++ b/openpgp/src/cert/amalgamation/iter.rs @@ -77,15 +77,11 @@ use crate::{ /// # } /// ``` /// -/// [`ComponentAmalgamationIter::with_policy`]: #method.with_policy -/// [`ComponentAmalgamation`]: struct.ComponentAmalgamation.html -/// [`ValidComponentAmalgamationIter`]: struct.ValidComponentAmalgamationIter.html -/// [`ValidComponentAmalgamation`]: struct.ValidComponentAmalgamation.html -/// [`Cert::userids`]: ../struct.Cert.html#method.userids -/// [`Cert::user_attributes`]: ../struct.Cert.html#method.user_attributes -/// [`Cert::unknowns`]: ../struct.Cert.html#method.unknown -/// [`Cert::keys`]: ../struct.Cert.html#method.keys -/// [`KeyAmalgamationIter`]: struct.KeyAmalgamationIter.html +/// [`ComponentAmalgamationIter::with_policy`]: ComponentAmalgamationIter::with_policy() +/// [`Cert::userids`]: super::Cert::userids() +/// [`Cert::user_attributes`]: super::Cert::user_attributes() +/// [`Cert::unknowns`]: super::Cert::unknown() +/// [`Cert::keys`]: super::Cert::keys() pub struct ComponentAmalgamationIter<'a, C> { cert: &'a Cert, iter: slice::Iter<'a, ComponentBundle>, @@ -96,7 +92,6 @@ assert_send_and_sync!(ComponentAmalgamationIter<'_, C> where C); /// /// A specialized version of [`ComponentAmalgamationIter`]. /// -/// [`ComponentAmalgamationIter`]: struct.ComponentAmalgamationIter.html pub type UserIDAmalgamationIter<'a> = ComponentAmalgamationIter<'a, UserID>; @@ -104,7 +99,6 @@ pub type UserIDAmalgamationIter<'a> /// /// A specialized version of [`ComponentAmalgamationIter`]. /// -/// [`ComponentAmalgamationIter`]: struct.ComponentAmalgamationIter.html pub type UserAttributeAmalgamationIter<'a> = ComponentAmalgamationIter<'a, UserAttribute>; @@ -112,7 +106,6 @@ pub type UserAttributeAmalgamationIter<'a> /// /// A specialized version of [`ComponentAmalgamationIter`]. /// -/// [`ComponentAmalgamationIter`]: struct.ComponentAmalgamationIter.html pub type UnknownComponentAmalgamationIter<'a> = ComponentAmalgamationIter<'a, Unknown>; @@ -175,7 +168,6 @@ impl<'a, C> ComponentAmalgamationIter<'a, C> { /// # } /// ``` /// - /// [`ValidateAmalgamation`]: trait.ValidateAmalgamation.html pub fn with_policy(self, policy: &'a dyn Policy, time: T) -> ValidComponentAmalgamationIter<'a, C> where T: Into> @@ -230,9 +222,8 @@ impl<'a, C> ComponentAmalgamationIter<'a, C> { /// # } /// ``` /// -/// [`ComponentAmalgamationIter`]: struct.ComponentAmalgamationIter.html -/// [`ValidComponentAmalgamationIter::revoked`]: #method.revoked -/// [`ComponentAmalgamationIter::with_policy`]: struct.ComponentAmalgamationIter.html#method.with_policy +/// [`ValidComponentAmalgamationIter::revoked`]: ValidComponentAmalgamationIter::revoked() +/// [`ComponentAmalgamationIter::with_policy`]: ComponentAmalgamationIter::with_policy() pub struct ValidComponentAmalgamationIter<'a, C> { // This is an option to make it easier to create an empty ValidComponentAmalgamationIter. cert: &'a Cert, @@ -379,7 +370,7 @@ impl<'a, C> ValidComponentAmalgamationIter<'a, C> { /// However, this filter implements a typical policy, and does not /// preclude using `filter` to realize alternative policies. /// - /// [`RevocationStatus::Revoked`]: ../../types/enum.RevocationStatus.html#variant.Revoked + /// [`RevocationStatus::Revoked`]: super::super::types::RevocationStatus::Revoked pub fn revoked(mut self, revoked: T) -> Self where T: Into> { diff --git a/openpgp/src/cert/amalgamation/key.rs b/openpgp/src/cert/amalgamation/key.rs index 11e4fc29..1e1c643c 100644 --- a/openpgp/src/cert/amalgamation/key.rs +++ b/openpgp/src/cert/amalgamation/key.rs @@ -236,15 +236,14 @@ //! # } //! ``` //! -//! [`KeyAmalgamation`]: struct.KeyAmalgamation.html -//! [`ComponentAmalgamation`]: ../struct.ComponentAmalgamation.html -//! [`Key`]: ../../../packet/key/index.html -//! [`Cert::keys`]: ../../struct.Cert.html#method.keys -//! [`PrimaryKeyAmalgamation`]: ../type.PrimaryKeyAmalgamation.html -//! [`SubordinateKeyAmalgamation`]: ../type.SubordinateKeyAmalgamation.html -//! [`ErasedKeyAmalgamation`]: ../type.ErasedKeyAmalgamation.html -//! [`KeyRole::UnspecifiedRole`]: ../../../packet/key/trait.KeyRole.html -//! [`Policy` discussion]: ../index.html +//! [`ComponentAmalgamation`]: super::ComponentAmalgamation +//! [`Key`]: super::super::super::packet::key +//! [`Cert::keys`]: super::super::Cert::keys() +//! [`PrimaryKeyAmalgamation`]: super::PrimaryKeyAmalgamation +//! [`SubordinateKeyAmalgamation`]: super::SubordinateKeyAmalgamation +//! [`ErasedKeyAmalgamation`]: super::ErasedKeyAmalgamation +//! [`KeyRole::UnspecifiedRole`]: super::super::super::packet::key::KeyRole +//! [`Policy` discussion]: super //! [This discussion]: https://crypto.stackexchange.com/a/12138 use std::time; use std::time::SystemTime; @@ -295,8 +294,7 @@ pub use iter::{ /// [`ValidKeyAmalgamation`], for instance, even though we only have /// specialized implementations of `PrimaryKey`. /// -/// [`ValidAmalgamation`]: ../trait.ValidAmalgamation.html -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html +/// [`ValidAmalgamation`]: super::ValidAmalgamation /// /// # Sealed trait /// @@ -432,16 +430,12 @@ pub trait PrimaryKey<'a, P, R>: seal::Sealed /// # } /// ``` /// -/// [`ComponentAmalgamation`]: ../struct.ComponentAmalgamation.html -/// [see the module's documentation]: index.html -/// [`PrimaryKeyAmalgamation`]: type.PrimaryKeyAmalgamation.html -/// [`SubordinateKeyAmalgamation`]: type.SubordinateKeyAmalgamation.html -/// [`ErasedKeyAmalgamation`]: type.ErasedKeyAmalgamation.html -/// [`Cert::primary_key`]: ../../../cert/struct.Cert.html#method.primary_key -/// [`Cert::keys`]: ../../../cert/struct.Cert.html#method.keys -/// [`ValidateAmalgamation`]: ../trait.ValidateAmalgamation.html -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html -/// [`KeyAmalgamation::with_policy`]: ../trait.ValidateAmalgamation.html#method.with_policy +/// [`ComponentAmalgamation`]: super::ComponentAmalgamation +/// [see the module's documentation]: self +/// [`Cert::primary_key`]: super::super::super::cert::Cert::primary_key() +/// [`Cert::keys`]: super::super::super::cert::Cert::keys() +/// [`ValidateAmalgamation`]: super::ValidateAmalgamation +/// [`KeyAmalgamation::with_policy`]: super::ValidateAmalgamation::with_policy() #[derive(Debug)] pub struct KeyAmalgamation<'a, P, R, R2> where P: 'a + key::KeyParts, @@ -479,7 +473,6 @@ impl<'a, P, R, R2> Clone for KeyAmalgamation<'a, P, R, R2> /// /// A specialized version of [`KeyAmalgamation`]. /// -/// [`KeyAmalgamation`]: struct.KeyAmalgamation.html pub type PrimaryKeyAmalgamation<'a, P> = KeyAmalgamation<'a, P, key::PrimaryRole, ()>; @@ -487,7 +480,6 @@ pub type PrimaryKeyAmalgamation<'a, P> /// /// A specialized version of [`KeyAmalgamation`]. /// -/// [`KeyAmalgamation`]: struct.KeyAmalgamation.html pub type SubordinateKeyAmalgamation<'a, P> = KeyAmalgamation<'a, P, key::SubordinateRole, ()>; @@ -500,10 +492,9 @@ pub type SubordinateKeyAmalgamation<'a, P> /// to the type system. For details, see the [module-level /// documentation]. /// -/// [`KeyAmalgamation`]: struct.KeyAmalgamation.html -/// [`Key`]: ../../../packet/key/index.html -/// [`KeyBundle`]: ../../bundle/index.html -/// [module-level documentation]: index.html +/// [`Key`]: super::super::super::packet::key +/// [`KeyBundle`]: super::super::bundle +/// [module-level documentation]: self pub type ErasedKeyAmalgamation<'a, P> = KeyAmalgamation<'a, P, key::UnspecifiedRole, bool>; @@ -922,14 +913,12 @@ impl<'a, P, R, R2> KeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// -/// [`ValidComponentAmalgamation`]: ../struct.ValidComponentAmalgamation.html -/// [`ComponentAmalgamation`]: ../struct.ComponentAmalgamation.html -/// [`KeyAmalgamation`]: struct.KeyAmalgamation.html -/// [`Policy`]: ../../../policy/index.html -/// [`ValidAmalgamation`]: ../trait.ValidAmalgamation.html -/// [`ValidAmalgamation::binding_signature`]: ../trait.ValidAmalgamation.html#method.binding_signature -/// [`ValidateAmalgamation::with_policy`]: ../trait.ValidateAmalgamation.html#tymethod.with_policy -/// [`KeyAmalgamationIter`]: struct.KeyAmalgamationIter.html +/// [`ValidComponentAmalgamation`]: super::ValidComponentAmalgamation +/// [`ComponentAmalgamation`]: super::ComponentAmalgamation +/// [`Policy`]: super::super::super::policy +/// [`ValidAmalgamation`]: super::ValidAmalgamation +/// [`ValidAmalgamation::binding_signature`]: super::ValidAmalgamation::binding_signature() +/// [`ValidateAmalgamation::with_policy`]: super::ValidateAmalgamation::with_policy #[derive(Debug, Clone)] pub struct ValidKeyAmalgamation<'a, P, R, R2> where P: 'a + key::KeyParts, @@ -958,7 +947,6 @@ assert_send_and_sync!(ValidKeyAmalgamation<'_, P, R, R2> /// /// A specialized version of [`ValidKeyAmalgamation`]. /// -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html pub type ValidPrimaryKeyAmalgamation<'a, P> = ValidKeyAmalgamation<'a, P, key::PrimaryRole, ()>; @@ -966,7 +954,6 @@ pub type ValidPrimaryKeyAmalgamation<'a, P> /// /// A specialized version of [`ValidKeyAmalgamation`]. /// -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html pub type ValidSubordinateKeyAmalgamation<'a, P> = ValidKeyAmalgamation<'a, P, key::SubordinateRole, ()>; @@ -974,7 +961,6 @@ pub type ValidSubordinateKeyAmalgamation<'a, P> /// /// A specialized version of [`ValidKeyAmalgamation`]. /// -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html pub type ValidErasedKeyAmalgamation<'a, P> = ValidKeyAmalgamation<'a, P, key::UnspecifiedRole, bool>; @@ -1322,7 +1308,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// /// For a definition of liveness, see the [`key_alive`] method. /// - /// [`key_alive`]: ../../../packet/signature/subpacket/struct.SubpacketAreas.html#method.key_alive + /// [`key_alive`]: super::super::super::packet::signature::subpacket::SubpacketAreas::key_alive() /// /// # Examples /// @@ -1521,7 +1507,7 @@ impl<'a, P> ValidSubordinateKeyAmalgamation<'a, P> /// when updating the expiration of an non signing-capable subkey. /// /// [primary key binding signature]: https://tools.ietf.org/html/rfc4880#section-5.2.1 - /// [`Error::InvalidArgument`]: ../../../enum.Error.html#variant.InvalidArgument + /// [`Error::InvalidArgument`]: super::super::super::Error::InvalidArgument /// /// # Examples /// @@ -1759,7 +1745,7 @@ impl<'a, P> ValidErasedKeyAmalgamation<'a, P> /// signing-capable subkey. /// /// [primary key binding signature]: https://tools.ietf.org/html/rfc4880#section-5.2.1 - /// [`Error::InvalidArgument`]: ../../../enum.Error.html#variant.InvalidArgument + /// [`Error::InvalidArgument`]: super::super::super::Error::InvalidArgument /// /// # Examples /// @@ -1942,7 +1928,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::key_flags`]: #method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() pub fn has_any_key_flag(&self, flags: F) -> bool where F: Borrow { @@ -1995,7 +1981,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// ``` /// /// [Section 12.1 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.21 - /// [`ValidKeyAmalgamation::key_flags`]: #method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() pub fn for_certification(&self) -> bool { self.has_any_key_flag(KeyFlags::empty().set_certification()) } @@ -2028,7 +2014,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::key_flags`]: #method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() pub fn for_signing(&self) -> bool { self.has_any_key_flag(KeyFlags::empty().set_signing()) } @@ -2061,7 +2047,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::key_flags`]: #method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() pub fn for_authentication(&self) -> bool { self.has_any_key_flag(KeyFlags::empty().set_authentication()) @@ -2108,7 +2094,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// /// [data at rest]: https://en.wikipedia.org/wiki/Data_at_rest /// [data in transit]: https://en.wikipedia.org/wiki/Data_in_transit - /// [`ValidKeyAmalgamation::key_flags`]: #method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() pub fn for_storage_encryption(&self) -> bool { self.has_any_key_flag(KeyFlags::empty().set_storage_encryption()) @@ -2155,7 +2141,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// /// [data at rest]: https://en.wikipedia.org/wiki/Data_at_rest /// [data in transit]: https://en.wikipedia.org/wiki/Data_in_transit - /// [`ValidKeyAmalgamation::key_flags`]: #method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() pub fn for_transport_encryption(&self) -> bool { self.has_any_key_flag(KeyFlags::empty().set_transport_encryption()) @@ -2203,7 +2189,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::key_expiration_time`]: #method.key_expiration_time + /// [`ValidKeyAmalgamation::key_expiration_time`]: PrimaryKey::key_expiration_time() /// [Section 5.2.3.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.3 pub fn key_validity_period(&self) -> Option { self.map(|s| s.key_validity_period()) @@ -2254,7 +2240,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::key_validity_period`]: #method.key_validity_period + /// [`ValidKeyAmalgamation::key_validity_period`]: PrimaryKey::key_validity_period() /// [Section 5.2.3.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.3 pub fn key_expiration_time(&self) -> Option { match self.key_validity_period() { diff --git a/openpgp/src/cert/amalgamation/key/iter.rs b/openpgp/src/cert/amalgamation/key/iter.rs index f21df0d9..7ff54abd 100644 --- a/openpgp/src/cert/amalgamation/key/iter.rs +++ b/openpgp/src/cert/amalgamation/key/iter.rs @@ -44,17 +44,13 @@ use crate::{ /// /// A `KeyAmalgamationIter` is returned by [`Cert::keys`]. /// -/// [`KeyAmalgamation`]: struct.KeyAmalgamation.html -/// [`ComponentAmalgamationIter`]: ../struct.ComponentAmalgamationIter.html -/// [module documentation]: index.html -/// [`KeyAmalgamationIter::with_policy`]: ../trait.ValidateAmalgamation.html -/// [`KeyAmalgamation`]: struct.KeyAmalgamation.html -/// [`ValidKeyAmalgamationIter`]: struct.ValidKeyAmalgamationIter.html -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html -/// [`KeyAmalgamationIter::secret`]: #method.secret -/// [`KeyAmalgamationIter::unencrypted_secret`]: #method.unencrypted_secret -/// [`Iterator::filter`]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.filter -/// [`Cert::keys`]: ../../struct.Cert.html#method.keys +/// [`ComponentAmalgamationIter`]: super::ComponentAmalgamationIter +/// [module documentation]: self +/// [`KeyAmalgamationIter::with_policy`]: super::ValidateAmalgamation +/// [`KeyAmalgamationIter::secret`]: KeyAmalgamationIter::secret() +/// [`KeyAmalgamationIter::unencrypted_secret`]: KeyAmalgamationIter::unencrypted_secret() +/// [`Iterator::filter`]: std::iter::Iterator::filter() +/// [`Cert::keys`]: super::super::Cert::keys() pub struct KeyAmalgamationIter<'a, P, R> where P: key::KeyParts, R: key::KeyRole, @@ -355,9 +351,9 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # } /// ``` /// - /// [`KeyHandle`s]: ../../../enum.KeyHandle.html - /// [`key_handles`]: #method.key_handles - /// [`KeyHandle::aliases`]: ../../../enum.KeyHandle.html#method.aliases + /// [`KeyHandle`s]: super::super::super::KeyHandle + /// [`key_handles`]: KeyAmalgamationIter::key_handles() + /// [`KeyHandle::aliases`]: super::super::super::KeyHandle::aliases() pub fn key_handle(mut self, h: H) -> Self where H: Into { @@ -399,9 +395,9 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # } /// ``` /// - /// [`KeyHandle`s]: ../../../enum.KeyHandle.html - /// [`key_handle`]: #method.key_handle - /// [`KeyHandle::aliases`]: ../../../enum.KeyHandle.html#method.aliases + /// [`KeyHandle`s]: super::super::super::KeyHandle + /// [`key_handle`]: KeyAmalgamationIter::key_handle() + /// [`KeyHandle::aliases`]: super::super::super::KeyHandle::aliases() pub fn key_handles<'b>(mut self, h: impl Iterator) -> Self where 'a: 'b @@ -474,8 +470,6 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # } /// ``` /// - /// [`ErasedKeyAmalgamation`]: type.ErasedKeyAmalgamation.html - /// [`SubordinateKeyAmalgamation`]: type.SubordinateKeyAmalgamation.html pub fn subkeys(self) -> KeyAmalgamationIter<'a, P, key::SubordinateRole> { KeyAmalgamationIter { cert: self.cert, @@ -526,9 +520,9 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # } /// ``` /// - /// [`ValidateAmalgamation`]: ../trait.ValidateAmalgamation.html - /// [`alive`]: struct.ValidKeyAmalgamationIter.html#method.alive - /// [`revoked`]: struct.ValidKeyAmalgamationIter.html#method.revoked + /// [`ValidateAmalgamation`]: super::ValidateAmalgamation + /// [`alive`]: ValidKeyAmalgamationIter::alive() + /// [`revoked`]: ValidKeyAmalgamationIter::revoked() pub fn with_policy(self, policy: &'a dyn Policy, time: T) -> ValidKeyAmalgamationIter<'a, P, R> where T: Into> @@ -628,14 +622,12 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # } /// ``` /// -/// [`ValidKeyAmalgamation`]: struct.ValidKeyAmalgamation.html -/// [`KeyAmalgamationIter`]: struct.KeyAmalgamationIter.html -/// [`Policy`]: ../../../policy/trait.Policy.html -/// [`ValidateAmalgamation`]: ../trait.ValidateAmalgamation.html -/// [`ValidKeyAmalgamationIter::revoked`]: #method.revoked -/// [`ValidKeyAmalgamationIter::alive`]: #method.alive -/// [`KeyAmalgamationIter::with_policy`]: struct.KeyAmalgamationIter.html#method.with_policy -/// [`ValidCert::keys`]: ../../struct.ValidCert.html#method.keys +/// [`Policy`]: super::super::super::policy::Policy +/// [`ValidateAmalgamation`]: super::ValidateAmalgamation +/// [`ValidKeyAmalgamationIter::revoked`]: ValidKeyAmalgamationIter::revoked() +/// [`ValidKeyAmalgamationIter::alive`]: ValidKeyAmalgamationIter::alive() +/// [`KeyAmalgamationIter::with_policy`]: KeyAmalgamationIter::with_policy() +/// [`ValidCert::keys`]: super::super::ValidCert::keys() pub struct ValidKeyAmalgamationIter<'a, P, R> where P: key::KeyParts, R: key::KeyRole, @@ -953,7 +945,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// ``` /// /// [Section 12.1 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.21 - /// [`ValidKeyAmalgamation::key_flags`]: struct.ValidKeyAmalgamation.html#method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: ValidKeyAmalgamation::key_flags() pub fn key_flags(mut self, flags: F) -> Self where F: Borrow { @@ -1020,9 +1012,9 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::for_certification`]: struct.ValidKeyAmalgamation.html#method.for_certification + /// [`ValidKeyAmalgamation::for_certification`]: ValidKeyAmalgamation::for_certification() /// [Section 12.1 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.21 - /// [`ValidKeyAmalgamation::key_flags`]: struct.ValidKeyAmalgamation.html#method.key_flags + /// [`ValidKeyAmalgamation::key_flags`]: ValidKeyAmalgamation::key_flags() pub fn for_certification(self) -> Self { self.key_flags(KeyFlags::empty().set_certification()) } @@ -1065,7 +1057,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::for_signing`]: struct.ValidKeyAmalgamation.html#method.for_signing + /// [`ValidKeyAmalgamation::for_signing`]: ValidKeyAmalgamation::for_signing() pub fn for_signing(self) -> Self { self.key_flags(KeyFlags::empty().set_signing()) } @@ -1108,7 +1100,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::for_authentication`]: struct.ValidKeyAmalgamation.html#method.for_authentication + /// [`ValidKeyAmalgamation::for_authentication`]: ValidKeyAmalgamation::for_authentication() pub fn for_authentication(self) -> Self { self.key_flags(KeyFlags::empty().set_authentication()) } @@ -1151,7 +1143,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::for_storage_encryption`]: struct.ValidKeyAmalgamation.html#method.for_storage_encryption + /// [`ValidKeyAmalgamation::for_storage_encryption`]: ValidKeyAmalgamation::for_storage_encryption() pub fn for_storage_encryption(self) -> Self { self.key_flags(KeyFlags::empty().set_storage_encryption()) } @@ -1194,7 +1186,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::for_transport_encryption`]: struct.ValidKeyAmalgamation.html#method.for_transport_encryption + /// [`ValidKeyAmalgamation::for_transport_encryption`]: ValidKeyAmalgamation::for_transport_encryption() pub fn for_transport_encryption(self) -> Self { self.key_flags(KeyFlags::empty().set_transport_encryption()) } @@ -1234,7 +1226,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # Ok(()) } /// ``` /// - /// [`key_alive`]: ../../../packet/signature/subpacket/struct.SubpacketAreas.html#method.key_alive + /// [`key_alive`]: super::super::super::packet::signature::subpacket::SubpacketAreas::key_alive() pub fn alive(mut self) -> Self { self.alive = Some(()); @@ -1466,9 +1458,9 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # } /// ``` /// - /// [`KeyHandle`s]: ../../../enum.KeyHandle.html - /// [`key_handles`]: #method.key_handles - /// [`KeyHandle::aliases`]: ../../../enum.KeyHandle.html#method.aliases + /// [`KeyHandle`s]: super::super::super::KeyHandle + /// [`key_handles`]: ValidKeyAmalgamationIter::key_handles() + /// [`KeyHandle::aliases`]: super::super::super::KeyHandle::aliases() pub fn key_handle(mut self, h: H) -> Self where H: Into { @@ -1514,9 +1506,9 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # } /// ``` /// - /// [`KeyHandle`s]: ../../../enum.KeyHandle.html - /// [`key_handle`]: #method.key_handle - /// [`KeyHandle::aliases`]: ../../../enum.KeyHandle.html#method.aliases + /// [`KeyHandle`s]: super::super::super::KeyHandle + /// [`key_handle`]: ValidKeyAmalgamationIter::key_handle() + /// [`KeyHandle::aliases`]: super::super::super::KeyHandle::aliases() pub fn key_handles<'b>(mut self, h: impl Iterator) -> Self where 'a: 'b @@ -1594,8 +1586,6 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # Ok(()) } /// ``` /// - /// [`ValidErasedKeyAmalgamation`]: type.ValidErasedKeyAmalgamation.html - /// [`ValidSubordinateKeyAmalgamation`]: type.ValidSubordinateKeyAmalgamation.html pub fn subkeys(self) -> ValidKeyAmalgamationIter<'a, P, key::SubordinateRole> { ValidKeyAmalgamationIter { cert: self.cert, diff --git a/openpgp/src/cert/bindings.rs b/openpgp/src/cert/bindings.rs index 91680bce..e0d692f1 100644 --- a/openpgp/src/cert/bindings.rs +++ b/openpgp/src/cert/bindings.rs @@ -23,7 +23,7 @@ impl Key { /// using [`SignatureBuilder::sign_primary_key_binding`]. /// /// [primary key binding signature]: https://tools.ietf.org/html/rfc4880#section-5.2.1 - /// [`SignatureBuilder::sign_primary_key_binding`]: signature/struct.SignatureBuilder.html#method.sign_primary_key_binding + /// [`SignatureBuilder::sign_primary_key_binding`]: signature::SignatureBuilder::sign_primary_key_binding() /// /// This function adds a creation time subpacket, a issuer /// fingerprint subpacket, and a issuer subpacket to the diff --git a/openpgp/src/cert/builder.rs b/openpgp/src/cert/builder.rs index 66154555..62b3be10 100644 --- a/openpgp/src/cert/builder.rs +++ b/openpgp/src/cert/builder.rs @@ -149,9 +149,9 @@ assert_send_and_sync!(KeyBlueprint); /// certificates manually, but it should be sufficiently powerful to /// cover most use cases. /// -/// [`UserID`s]: ../packet/struct.UserID.html -/// [`UserAttribute`s]: ../packet/user_attribute/struct.UserAttribute.html -/// [`Key`s]: ../packet/key/enum.Key.html +/// [`UserID`s]: super::packet::UserID +/// [`UserAttribute`s]: super::packet::user_attribute::UserAttribute +/// [`Key`s]: super::packet::key::Key /// /// # Examples /// @@ -192,9 +192,9 @@ impl CertBuilder<'_> { /// [`CertBuilder::add_signing_subkey`], /// [`CertBuilder::add_transport_encryption_subkey`], etc.). /// - /// [`CertBuilder::add_signing_subkey`]: #method.add_signing_subkey - /// [`CertBuilder::add_transport_encryption_subkey`]: #method.add_transport_encryption_subkey - /// [`CertBuilder::add_userid`]: #method.add_userid + /// [`CertBuilder::add_signing_subkey`]: CertBuilder::add_signing_subkey() + /// [`CertBuilder::add_transport_encryption_subkey`]: CertBuilder::add_transport_encryption_subkey() + /// [`CertBuilder::add_userid`]: CertBuilder::add_userid() /// /// # Examples /// @@ -303,10 +303,10 @@ impl CertBuilder<'_> { /// representable by a `Timestamp`. If it is not in range, /// [`generate`] will return an error. /// - /// [`CertBuilder::generate`]: #method.generate - /// [`SystemTime`]: https://doc.rust-lang.org/stable/std/time/struct.SystemTime.html - /// [`Timestamp`]: ../types/struct.Timestamp.html - /// [`generate`]: #method.generate + /// [`CertBuilder::generate`]: CertBuilder::generate() + /// [`SystemTime`]: std::time::SystemTime + /// [`Timestamp`]: super::types::Timestamp + /// [`generate`]: CertBuilder::generate() /// /// # Examples /// @@ -410,7 +410,7 @@ impl CertBuilder<'_> { /// [`CertBuilder::general_purpose`], will have the [primary User /// ID flag] set. /// - /// [`CertBuilder::general_purpose`]: #method.general_purpose + /// [`CertBuilder::general_purpose`]: CertBuilder::general_purpose() /// [primary User ID flag]: https://tools.ietf.org/html/rfc4880#section-5.2.3.19 /// /// # Examples @@ -732,8 +732,8 @@ impl CertBuilder<'_> { /// Use [`CertBuilder::add_subkey`] if you need to change these /// parameters. /// - /// [`CertBuilder::set_cipher_suite`]: #method.set_cipher_suite - /// [`CertBuilder::add_subkey`]: #method.add_subkey + /// [`CertBuilder::set_cipher_suite`]: CertBuilder::set_cipher_suite() + /// [`CertBuilder::add_subkey`]: CertBuilder::add_subkey() /// /// # Examples /// @@ -769,8 +769,8 @@ impl CertBuilder<'_> { /// Use [`CertBuilder::add_subkey`] if you need to change these /// parameters. /// - /// [`CertBuilder::set_cipher_suite`]: #method.set_cipher_suite - /// [`CertBuilder::add_subkey`]: #method.add_subkey + /// [`CertBuilder::set_cipher_suite`]: CertBuilder::set_cipher_suite() + /// [`CertBuilder::add_subkey`]: CertBuilder::add_subkey() /// /// /// # Examples @@ -808,8 +808,8 @@ impl CertBuilder<'_> { /// Use [`CertBuilder::add_subkey`] if you need to change these /// parameters. /// - /// [`CertBuilder::set_cipher_suite`]: #method.set_cipher_suite - /// [`CertBuilder::add_subkey`]: #method.add_subkey + /// [`CertBuilder::set_cipher_suite`]: CertBuilder::set_cipher_suite() + /// [`CertBuilder::add_subkey`]: CertBuilder::add_subkey() /// /// /// # Examples @@ -847,8 +847,8 @@ impl CertBuilder<'_> { /// Use [`CertBuilder::add_subkey`] if you need to change these /// parameters. /// - /// [`CertBuilder::set_cipher_suite`]: #method.set_cipher_suite - /// [`CertBuilder::add_subkey`]: #method.add_subkey + /// [`CertBuilder::set_cipher_suite`]: CertBuilder::set_cipher_suite() + /// [`CertBuilder::add_subkey`]: CertBuilder::add_subkey() /// /// /// # Examples @@ -885,8 +885,8 @@ impl CertBuilder<'_> { /// Use [`CertBuilder::add_subkey`] if you need to change these /// parameters. /// - /// [`CertBuilder::set_cipher_suite`]: #method.set_cipher_suite - /// [`CertBuilder::add_subkey`]: #method.add_subkey + /// [`CertBuilder::set_cipher_suite`]: CertBuilder::set_cipher_suite() + /// [`CertBuilder::add_subkey`]: CertBuilder::add_subkey() /// /// /// # Examples diff --git a/openpgp/src/cert/bundle.rs b/openpgp/src/cert/bundle.rs index a24e9eb3..a571d578 100644 --- a/openpgp/src/cert/bundle.rs +++ b/openpgp/src/cert/bundle.rs @@ -65,18 +65,17 @@ //! methods that implement the [complicated semantics] for correctly //! locating information. //! -//! [`Cert`]: ../index.html -//! [`Packet`]: ../../packet/index.html -//! [`Signature`]: ../../packet/signature/index.html -//! [`ComponentBundle`]: ./struct.ComponentBundle.html -//! [`Key`]: ../../packet/key/index.html -//! [`UserID`]: ../../packet/struct.UserID.html -//! [`UserAttribute`]: ../../packet/user_attribute/index.html -//! [`Unknown`]: ../../packet/struct.Unknown.html -//! [`Tag`]: ../../packet/enum.Tag.html +//! [`Cert`]: super +//! [`Packet`]: super::super::packet +//! [`Signature`]: super::super::packet::signature +//! [`Key`]: super::super::packet::key +//! [`UserID`]: super::super::packet::UserID +//! [`UserAttribute`]: super::super::packet::user_attribute +//! [`Unknown`]: super::super::packet::Unknown +//! [`Tag`]: super::super::packet::Tag //! [designated revoker]: https://tools.ietf.org/html/rfc4880#section-5.2.3.15 -//! [`ComponentAmalgamation`]: ../amalgamation/index.html -//! [`KeyAmalgamation`]: ../key_amalgamation/index.html +//! [`ComponentAmalgamation`]: super::amalgamation +//! [`KeyAmalgamation`]: super::key_amalgamation //! [complicated semantics]: https://tools.ietf.org/html/rfc4880#section-5.2.3.3 use std::time; @@ -107,7 +106,7 @@ use super::{ /// A certificate component and its associated signatures. /// -/// [See the module level documentation](index.html) for a detailed +/// [See the module level documentation](self) for a detailed /// description. #[derive(Debug, Clone, PartialEq)] pub struct ComponentBundle { @@ -136,36 +135,36 @@ assert_send_and_sync!(ComponentBundle where C); /// A key (primary or subkey, public or private) and any associated /// signatures. /// -/// [See the module level documentation.](index.html) +/// [See the module level documentation.](self) pub type KeyBundle = ComponentBundle>; /// A primary key and any associated signatures. /// -/// [See the module level documentation.](index.html) +/// [See the module level documentation.](self) pub type PrimaryKeyBundle = KeyBundle; /// A subkey and any associated signatures. /// -/// [See the module level documentation.](index.html) +/// [See the module level documentation.](self) pub type SubkeyBundle = KeyBundle; /// A User ID and any associated signatures. /// -/// [See the module level documentation.](index.html) +/// [See the module level documentation.](self) pub type UserIDBundle = ComponentBundle; /// A User Attribute and any associated signatures. /// -/// [See the module level documentation.](index.html) +/// [See the module level documentation.](self) pub type UserAttributeBundle = ComponentBundle; /// An unknown component and any associated signatures. /// /// Note: all signatures are stored as certifications. /// -/// [See the module level documentation.](index.html) +/// [See the module level documentation.](self) pub type UnknownBundle = ComponentBundle; @@ -790,7 +789,7 @@ impl ComponentBundle> { /// This is just a type-specific alias for /// [`ComponentBundle::component`]. /// - /// [`ComponentBundle::component`]: #method.component + /// [`ComponentBundle::component`]: ComponentBundle::component() /// /// # Examples /// @@ -871,7 +870,7 @@ impl ComponentBundle { /// This is just a type-specific alias for /// [`ComponentBundle::component`]. /// - /// [`ComponentBundle::component`]: #method.component + /// [`ComponentBundle::component`]: ComponentBundle::component() /// /// # Examples /// @@ -946,7 +945,7 @@ impl ComponentBundle { /// This is just a type-specific alias for /// [`ComponentBundle::component`]. /// - /// [`ComponentBundle::component`]: #method.component + /// [`ComponentBundle::component`]: ComponentBundle::component() /// /// # Examples /// @@ -1017,7 +1016,7 @@ impl ComponentBundle { /// This is just a type-specific alias for /// [`ComponentBundle::component`]. /// - /// [`ComponentBundle::component`]: #method.component + /// [`ComponentBundle::component`]: ComponentBundle::component() /// /// # Examples /// diff --git a/openpgp/src/cert/parser/mod.rs b/openpgp/src/cert/parser/mod.rs index 560ff76d..66c6eab3 100644 --- a/openpgp/src/cert/parser/mod.rs +++ b/openpgp/src/cert/parser/mod.rs @@ -386,15 +386,15 @@ impl CertValidato