diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-12-04 13:07:24 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-12-04 13:21:47 +0100 |
commit | 43f4017c820c9b67c9e08f860182ab5c7126fc68 (patch) | |
tree | 0f6fc3ad9fceca65988212fea94f816928d8c74f /guide | |
parent | 98253e6dbeffdff0e74ed4258fbc7a3fe38232a0 (diff) |
openpgp: Refine CertBuilder::add_encryption_subkey.
Diffstat (limited to 'guide')
-rw-r--r-- | guide/src/chapter_02.md | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/guide/src/chapter_02.md b/guide/src/chapter_02.md index bfaccfb8..cc024348 100644 --- a/guide/src/chapter_02.md +++ b/guide/src/chapter_02.md @@ -38,7 +38,7 @@ fn main() { # fn generate() -> openpgp::Result<openpgp::Cert> { # let (cert, _revocation) = openpgp::cert::CertBuilder::new() # .add_userid("someone@example.org") -# .add_encryption_subkey() +# .add_transport_encryption_subkey() # .generate()?; # # // Save the revocation certificate somewhere. @@ -52,7 +52,6 @@ fn main() { # // Build a vector of recipients to hand to Encryptor. # let mut recipients = # recipient.keys_valid() -# .for_storage_encryption() # .for_transport_encryption() # .map(|(_, _, key)| key.into()) # .collect::<Vec<_>>(); @@ -180,7 +179,7 @@ create it: fn generate() -> openpgp::Result<openpgp::Cert> { let (cert, _revocation) = openpgp::cert::CertBuilder::new() .add_userid("someone@example.org") - .add_encryption_subkey() + .add_transport_encryption_subkey() .generate()?; // Save the revocation certificate somewhere. @@ -194,7 +193,6 @@ fn generate() -> openpgp::Result<openpgp::Cert> { # // Build a vector of recipients to hand to Encryptor. # let mut recipients = # recipient.keys_valid() -# .for_storage_encryption() # .for_transport_encryption() # .map(|(_, _, key)| key.into()) # .collect::<Vec<_>>(); @@ -322,7 +320,7 @@ implements [`io::Write`], and we simply write the plaintext to it. # fn generate() -> openpgp::Result<openpgp::Cert> { # let (cert, _revocation) = openpgp::cert::CertBuilder::new() # .add_userid("someone@example.org") -# .add_encryption_subkey() +# .add_transport_encryption_subkey() # .generate()?; # # // Save the revocation certificate somewhere. @@ -336,7 +334,6 @@ fn encrypt(sink: &mut Write, plaintext: &str, recipient: &openpgp::Cert) // Build a vector of recipients to hand to Encryptor. let mut recipients = recipient.keys_valid() - .for_storage_encryption() .for_transport_encryption() .map(|(_, _, key)| key.into()) .collect::<Vec<_>>(); @@ -478,7 +475,7 @@ Decrypted data can be read from this using [`io::Read`]. # fn generate() -> openpgp::Result<openpgp::Cert> { # let (cert, _revocation) = openpgp::cert::CertBuilder::new() # .add_userid("someone@example.org") -# .add_encryption_subkey() +# .add_transport_encryption_subkey() # .generate()?; # # // Save the revocation certificate somewhere. @@ -492,7 +489,6 @@ Decrypted data can be read from this using [`io::Read`]. # // Build a vector of recipients to hand to Encryptor. # let mut recipients = # recipient.keys_valid() -# .for_storage_encryption() # .for_transport_encryption() # .map(|(_, _, key)| key.into()) # .collect::<Vec<_>>(); |