From fc514ce424f71f0146f70727a548ec8009a06f1b Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 29 Jan 2019 15:07:38 +0100 Subject: store: Fix documentation. - In a1eba557ff62f09bef2c7e379a238c643ac240d7, I changed the store to insert all subkeys into the key_to_keyid table. Update the documentation to reflect this change. --- store/src/lib.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'store/src') diff --git a/store/src/lib.rs b/store/src/lib.rs index 9172ee7c..ec977b08 100644 --- a/store/src/lib.rs +++ b/store/src/lib.rs @@ -218,10 +218,7 @@ impl Pool { /// Looks up a key in the common key pool by (Sub)KeyID. /// - /// The KeyID may also reference a signing- or - /// certification-capable subkey. The reason for this restriction - /// is that anyone can attach any subkey to her TPK, but signing- - /// or certification-capable subkeys require back signatures. + /// The KeyID may also reference a subkey. /// /// # Example /// @@ -240,16 +237,24 @@ impl Pool { /// # .ipc_policy(IPCPolicy::Internal) /// # .ephemeral().build()?; /// # let tpk = TPK::from_bytes( - /// # include_bytes!("../../openpgp/tests/data/keys/emmelie-dorothea-dina-samantha-awina-ed25519.pgp")) + /// # include_bytes!("../../openpgp/tests/data/keys/neal.pgp")) /// # .unwrap(); /// Pool::import(&ctx, &tpk)?; /// /// // Lookup by the primary key's KeyID. - /// let key = Pool::lookup_by_subkeyid(&ctx, &KeyID::from_hex("069C0C348DD82C19")?)?; + /// let key = Pool::lookup_by_subkeyid(&ctx, &KeyID::from_hex("AACB3243630052D9")?)?; /// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint()); /// - /// // Lookup by the subkey's KeyID. - /// let key = Pool::lookup_by_subkeyid(&ctx, &KeyID::from_hex("22E3FAFE96B56C32")?)?; + /// // Lookup by the signing subkey's KeyID. + /// let key = Pool::lookup_by_subkeyid(&ctx, &KeyID::from_hex("7223B56678E02528")?)?; + /// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint()); + /// + /// // Lookup by the encryption subkey's KeyID. + /// let key = Pool::lookup_by_subkeyid(&ctx, &KeyID::from_hex("C2B819056C652598")?)?; + /// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint()); + /// + /// // Lookup by the authentication subkey's KeyID. + /// let key = Pool::lookup_by_subkeyid(&ctx, &KeyID::from_hex("A3506AFB820ABD08")?)?; /// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint()); /// # Ok(()) /// # } @@ -451,10 +456,7 @@ impl Store { /// Looks up a key by (Sub)KeyID. /// - /// The KeyID may also reference a signing- or - /// certification-capable subkey. The reason for this restriction - /// is that anyone can attach any subkey to her TPK, but signing- - /// or certification-capable subkeys require back signatures. + /// The KeyID may also reference a subkey. /// /// # Example /// -- cgit v1.2.3