diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-06 14:49:01 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-06 15:06:09 +0100 |
commit | d6ed2a3cbb18c50c2da73d5efbdade343e3bad12 (patch) | |
tree | 15cefd9945499ab20065acb30df86d3ccd829cca /guide/src | |
parent | 23110e2844a19ffdd1d5c1699cb868f93f734ccc (diff) |
openpgp: Rename methods 'set_policy' to 'with_policy'.
- Fixes #427.
Diffstat (limited to 'guide/src')
-rw-r--r-- | guide/src/chapter_01.md | 8 | ||||
-rw-r--r-- | guide/src/chapter_02.md | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/guide/src/chapter_01.md b/guide/src/chapter_01.md index 629515eb..178e8e83 100644 --- a/guide/src/chapter_01.md +++ b/guide/src/chapter_01.md @@ -57,7 +57,7 @@ fn main() { # -> openpgp::Result<()> # { # // Get the keypair to do the signing from the Cert. -# let keypair = tsk.keys().set_policy(policy, None) +# let keypair = tsk.keys().with_policy(policy, None) # .alive().revoked(false).for_signing().nth(0).unwrap() # .key().clone().mark_parts_secret().unwrap().into_keypair()?; # @@ -211,7 +211,7 @@ fn generate() -> openpgp::Result<openpgp::Cert> { # -> openpgp::Result<()> # { # // Get the keypair to do the signing from the Cert. -# let keypair = tsk.keys().set_policy(policy, None) +# let keypair = tsk.keys().with_policy(policy, None) # .alive().revoked(false).for_signing().nth(0).unwrap() # .key().clone().mark_parts_secret().unwrap().into_keypair()?; # @@ -365,7 +365,7 @@ fn sign(policy: &dyn Policy, -> openpgp::Result<()> { // Get the keypair to do the signing from the Cert. - let keypair = tsk.keys().set_policy(policy, None) + let keypair = tsk.keys().with_policy(policy, None) .alive().revoked(false).for_signing().nth(0).unwrap() .key().clone().mark_parts_secret().unwrap().into_keypair()?; @@ -530,7 +530,7 @@ Verified data can be read from this using [`io::Read`]. # -> openpgp::Result<()> # { # // Get the keypair to do the signing from the Cert. -# let keypair = tsk.keys().set_policy(policy, None) +# let keypair = tsk.keys().with_policy(policy, None) # .alive().revoked(false).for_signing().nth(0).unwrap() # .key().clone().mark_parts_secret().unwrap().into_keypair()?; # diff --git a/guide/src/chapter_02.md b/guide/src/chapter_02.md index 6f18c59c..ffa0b29b 100644 --- a/guide/src/chapter_02.md +++ b/guide/src/chapter_02.md @@ -56,7 +56,7 @@ fn main() { # -> openpgp::Result<()> { # // Build a vector of recipients to hand to Encryptor. # let mut recipients = -# recipient.keys().set_policy(policy, None).alive().revoked(false) +# recipient.keys().with_policy(policy, None).alive().revoked(false) # .for_transport_encryption() # .map(|ka| ka.key().into()) # .collect::<Vec<_>>(); @@ -133,7 +133,7 @@ fn main() { # where D: FnMut(SymmetricAlgorithm, &SessionKey) -> openpgp::Result<()> # { # // The encryption key is the first and only subkey. -# let key = self.secret.keys().set_policy(self.policy, None) +# let key = self.secret.keys().with_policy(self.policy, None) # .for_transport_encryption().nth(0).unwrap().key().clone(); # # // The secret key is not encrypted. @@ -204,7 +204,7 @@ fn generate() -> openpgp::Result<openpgp::Cert> { # -> openpgp::Result<()> { # // Build a vector of recipients to hand to Encryptor. # let mut recipients = -# recipient.keys().set_policy(policy, None).alive().revoked(false) +# recipient.keys().with_policy(policy, None).alive().revoked(false) # .for_transport_encryption() # .map(|ka| ka.key().into()) # .collect::<Vec<_>>(); @@ -281,7 +281,7 @@ fn generate() -> openpgp::Result<openpgp::Cert> { # where D: FnMut(SymmetricAlgorithm, &SessionKey) -> openpgp::Result<()> # { # // The encryption key is the first and only subkey. -# let key = self.secret.keys().set_policy(self.policy, None) +# let key = self.secret.keys().with_policy(self.policy, None) # .for_transport_encryption().nth(0).unwrap().key().clone(); # # // The secret key is not encrypted. @@ -352,7 +352,7 @@ fn encrypt(policy: &dyn Policy, -> openpgp::Result<()> { // Build a vector of recipients to hand to Encryptor. let mut recipients = - recipient.keys().set_policy(policy, None).alive().revoked(false) + recipient.keys().with_policy(policy, None).alive().revoked(false) .for_transport_encryption() .map(|ka| ka.key().into()) .collect::<Vec<_>>(); @@ -429,7 +429,7 @@ fn encrypt(policy: &dyn Policy, # where D: FnMut(SymmetricAlgorithm, &SessionKey) -> openpgp::Result<()> # { # // The encryption key is the first and only subkey. -# let key = self.secret.keys().set_policy(self.policy, None) +# let key = self.secret.keys().with_policy(self.policy, None) # .for_transport_encryption().nth(0).unwrap().key().clone(); # # // The secret key is not encrypted. @@ -514,7 +514,7 @@ Decrypted data can be read from this using [`io::Read`]. # -> openpgp::Result<()> { # // Build a vector of recipients to hand to Encryptor. # let mut recipients = -# recipient.keys().set_policy(policy, None).alive().revoked(false) +# recipient.keys().with_policy(policy, None).alive().revoked(false) # .for_transport_encryption() # .map(|ka| ka.key().into()) # .collect::<Vec<_>>(); @@ -590,7 +590,7 @@ impl<'a> DecryptionHelper for Helper<'a> { -> openpgp::Result<Option<openpgp::Fingerprint>> where D: FnMut(SymmetricAlgorithm, &SessionKey) -> openpgp::Result<()> { - let key = self.secret.keys().set_policy(self.policy, None) + let key = self.secret.keys().with_policy(self.policy, None) .for_transport_encryption().nth(0).unwrap().key().clone(); // The secret key is not encrypted. |