summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-08-23 16:55:26 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2021-08-27 12:58:07 +0200
commite5746684e84377dd8828f6a5a8ab4c0eec73c3ec (patch)
tree5261ba9f497ec5ce51d47198742919673de3c893 /openpgp
parent078c4d7ee16ea06977ec8cb7cf5571c880e9c710 (diff)
Convert markdown to intra-doc links.
- Apply cargo intraconv.
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/src/cert.rs125
-rw-r--r--openpgp/src/cert/amalgamation.rs65
-rw-r--r--openpgp/src/cert/amalgamation/iter.rs25
-rw-r--r--openpgp/src/cert/amalgamation/key.rs84
-rw-r--r--openpgp/src/cert/amalgamation/key/iter.rs82
-rw-r--r--openpgp/src/cert/bindings.rs2
-rw-r--r--openpgp/src/cert/builder.rs42
-rw-r--r--openpgp/src/cert/bundle.rs43
-rw-r--r--openpgp/src/cert/parser/mod.rs16
-rw-r--r--openpgp/src/cert/revoke.rs12
-rw-r--r--openpgp/src/crypto/asymmetric.rs14
-rw-r--r--openpgp/src/crypto/backend/cng/hash.rs2
-rw-r--r--openpgp/src/crypto/backend/nettle.rs2
-rw-r--r--openpgp/src/crypto/backend/nettle/asymmetric.rs6
-rw-r--r--openpgp/src/crypto/backend/nettle/hash.rs2
-rw-r--r--openpgp/src/crypto/hash.rs16
-rw-r--r--openpgp/src/crypto/mem.rs4
-rw-r--r--openpgp/src/crypto/mod.rs16
-rw-r--r--openpgp/src/crypto/mpi.rs18
-rw-r--r--openpgp/src/crypto/s2k.rs9
-rw-r--r--openpgp/src/fingerprint.rs6
-rw-r--r--openpgp/src/keyhandle.rs4
-rw-r--r--openpgp/src/keyid.rs4
-rw-r--r--openpgp/src/message/mod.rs8
-rw-r--r--openpgp/src/packet/aed.rs6
-rw-r--r--openpgp/src/packet/container.rs30
-rw-r--r--openpgp/src/packet/header/ctb.rs8
-rw-r--r--openpgp/src/packet/header/mod.rs10
-rw-r--r--openpgp/src/packet/key.rs161
-rw-r--r--openpgp/src/packet/mod.rs146
-rw-r--r--openpgp/src/packet/signature.rs306
-rw-r--r--openpgp/src/packet/signature/subpacket.rs171
-rw-r--r--openpgp/src/packet/skesk.rs18
-rw-r--r--openpgp/src/packet/tag.rs2
-rw-r--r--openpgp/src/packet/unknown.rs2
-rw-r--r--openpgp/src/packet/user_attribute.rs4
-rw-r--r--openpgp/src/packet/userid.rs26
-rw-r--r--openpgp/src/packet_pile.rs2
-rw-r--r--openpgp/src/parse.rs131
-rw-r--r--openpgp/src/parse/hashed_reader.rs2
-rw-r--r--openpgp/src/parse/map.rs7
-rw-r--r--openpgp/src/parse/packet_parser_builder.rs16
-rw-r--r--openpgp/src/parse/packet_pile_parser.rs9
-rw-r--r--openpgp/src/parse/stream.rs116
-rw-r--r--openpgp/src/policy.rs34
-rw-r--r--openpgp/src/regex/mod.rs63
-rw-r--r--openpgp/src/seal.rs2
-rw-r--r--openpgp/src/serialize.rs72
-rw-r--r--openpgp/src/serialize/cert.rs10
-rw-r--r--openpgp/src/serialize/stream.rs86
-rw-r--r--openpgp/src/serialize/stream/padding.rs14
-rw-r--r--openpgp/src/types/compression_level.rs3
-rw-r--r--openpgp/src/types/features.rs2
-rw-r--r--openpgp/src/types/key_flags.rs2
-rw-r--r--openpgp/src/types/mod.rs14
-rw-r--r--openpgp/src/types/revocation_key.rs4
-rw-r--r--openpgp/src/types/server_preferences.rs6
-rw-r--r--openpgp/src/types/timestamp.rs8
58 files changed, 924 insertions, 1176 deletions
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::V