summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/encrypt-for.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/examples/encrypt-for.rs')
-rw-r--r--openpgp/examples/encrypt-for.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/openpgp/examples/encrypt-for.rs b/openpgp/examples/encrypt-for.rs
index a5d7150a..bc70e307 100644
--- a/openpgp/examples/encrypt-for.rs
+++ b/openpgp/examples/encrypt-for.rs
@@ -8,7 +8,7 @@ extern crate openpgp;
use openpgp::armor;
use openpgp::constants::DataFormat;
use openpgp::serialize::stream::{
- wrap, LiteralWriter, Encryptor, EncryptionMode,
+ Message, LiteralWriter, Encryptor, EncryptionMode,
};
fn main() {
@@ -45,8 +45,11 @@ fn main() {
let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[][..])
.expect("Failed to create an armored writer");
+ // Stream an OpenPGP message.
+ let message = Message::new(sink);
+
// We want to encrypt a literal data packet.
- let encryptor = Encryptor::new(wrap(sink),
+ let encryptor = Encryptor::new(message,
&[], // No symmetric encryption.
&recipients,
mode)