diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-06 17:43:36 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-06 17:43:36 +0100 |
commit | 2bd001a81fa53e4f3cbc972f6354c8e3e510d1c7 (patch) | |
tree | 309def367e301d8daad3a759eff446d3c96982ad | |
parent | 5655371fc46b669cee17f83be095c97cc816f4fb (diff) |
openpgp: Fix name of setter.
-rw-r--r-- | openpgp/src/cert/bindings.rs | 6 | ||||
-rw-r--r-- | openpgp/src/cert/builder.rs | 6 | ||||
-rw-r--r-- | openpgp/src/types/timestamp.rs | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/openpgp/src/cert/bindings.rs b/openpgp/src/cert/bindings.rs index 582ff705..8c08b622 100644 --- a/openpgp/src/cert/bindings.rs +++ b/openpgp/src/cert/bindings.rs @@ -151,7 +151,7 @@ impl UserID { /// # fn f() -> Result<()> { /// // Generate a Cert, and create a keypair from the primary key. /// let (alice, _) = CertBuilder::new() - /// .primary_key_flags(KeyFlags::default().set_certification(true)) + /// .set_primary_key_flags(KeyFlags::default().set_certification(true)) /// .add_userid("alice@example.org") /// .generate()?; /// let mut keypair = alice.primary_key().key().clone() @@ -159,7 +159,7 @@ impl UserID { /// /// // Generate a Cert for Bob. /// let (bob, _) = CertBuilder::new() - /// .primary_key_flags(KeyFlags::default().set_certification(true)) + /// .set_primary_key_flags(KeyFlags::default().set_certification(true)) /// .add_userid("bob@example.org") /// .generate()?; /// @@ -301,7 +301,7 @@ impl UserAttribute { /// Image::Private(100, vec![0, 1, 2].into_boxed_slice())), /// ])?; /// let (bob, _) = CertBuilder::new() - /// .primary_key_flags(KeyFlags::default().set_certification(true)) + /// .set_primary_key_flags(KeyFlags::default().set_certification(true)) /// .add_user_attribute(user_attr) /// .generate()?; /// diff --git a/openpgp/src/cert/builder.rs b/openpgp/src/cert/builder.rs index 171627f2..57bf5597 100644 --- a/openpgp/src/cert/builder.rs +++ b/openpgp/src/cert/builder.rs @@ -293,7 +293,7 @@ impl CertBuilder { /// Sets the capabilities of the primary key. The function automatically /// makes the primary key certification capable if subkeys are added. - pub fn primary_key_flags(mut self, flags: KeyFlags) -> Self { + pub fn set_primary_key_flags(mut self, flags: KeyFlags) -> Self { self.primary.flags = flags; self } @@ -578,7 +578,7 @@ mod tests { let p = &P::new(); let (cert1, _) = CertBuilder::new() .set_cipher_suite(CipherSuite::Cv25519) - .primary_key_flags(KeyFlags::default()) + .set_primary_key_flags(KeyFlags::default()) .add_transport_encryption_subkey() .generate().unwrap(); assert!(cert1.primary_key().with_policy(p, None).unwrap().for_certification()); @@ -589,7 +589,7 @@ mod tests { fn gen_wired_subkeys() { let (cert1, _) = CertBuilder::new() .set_cipher_suite(CipherSuite::Cv25519) - .primary_key_flags(KeyFlags::default()) + .set_primary_key_flags(KeyFlags::default()) .add_subkey(KeyFlags::default().set_certification(true), None) .generate().unwrap(); let sig_pkts = cert1.subkeys().next().unwrap().self_signatures[0].hashed_area(); diff --git a/openpgp/src/types/timestamp.rs b/openpgp/src/types/timestamp.rs index aa60812c..b512fa35 100644 --- a/openpgp/src/types/timestamp.rs +++ b/openpgp/src/types/timestamp.rs @@ -112,14 +112,14 @@ impl Timestamp { /// // Generate a Cert for Alice. /// let (alice, _) = CertBuilder::new() /// .set_creation_time(now.checked_sub(Duration::weeks(2)?).unwrap()) - /// .primary_key_flags(KeyFlags::default().set_certification(true)) + /// .set_primary_key_flags(KeyFlags::default().set_certification(true)) /// .add_userid("alice@example.org") /// .generate()?; /// /// // Generate a Cert for Bob. /// let (bob, _) = CertBuilder::new() /// .set_creation_time(now.checked_sub(Duration::weeks(1)?).unwrap()) - /// .primary_key_flags(KeyFlags::default().set_certification(true)) + /// .set_primary_key_flags(KeyFlags::default().set_certification(true)) /// .add_userid("bob@example.org") /// .generate()?; /// |