summaryrefslogtreecommitdiffstats
path: root/openpgp/examples
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-07-10 10:55:10 +0200
committerJustus Winter <justus@sequoia-pgp.org>2018-07-10 10:55:10 +0200
commit9ce7ed2c8f53ece40b7f48d5cb9e7e06e80524e3 (patch)
tree4afe8d81b05ad1dfbabcc8253568d64c28202fc5 /openpgp/examples
parent6b9a1cc320a53e28fb1b9c99cb7897db797f253a (diff)
openpgp: Add and use a type for the literal data packet's format.
Diffstat (limited to 'openpgp/examples')
-rw-r--r--openpgp/examples/encrypt-for.rs4
-rw-r--r--openpgp/examples/sign.rs3
2 files changed, 5 insertions, 2 deletions
diff --git a/openpgp/examples/encrypt-for.rs b/openpgp/examples/encrypt-for.rs
index 5fe9360f..9e5c2cdf 100644
--- a/openpgp/examples/encrypt-for.rs
+++ b/openpgp/examples/encrypt-for.rs
@@ -5,6 +5,7 @@ use std::io;
extern crate openpgp;
use openpgp::armor;
+use openpgp::constants::DataFormat;
use openpgp::serialize::stream::{
wrap, LiteralWriter, Encryptor, EncryptionMode,
};
@@ -47,7 +48,8 @@ fn main() {
&recipients,
mode)
.expect("Failed to create encryptor");
- let mut literal_writer = LiteralWriter::new(encryptor, 't', None, None)
+ let mut literal_writer = LiteralWriter::new(encryptor, DataFormat::Binary,
+ None, None)
.expect("Failed to create literal writer");
// Finally, copy stdin to our writer stack to encrypt the data.
diff --git a/openpgp/examples/sign.rs b/openpgp/examples/sign.rs
index 1d2376c2..a071dacf 100644
--- a/openpgp/examples/sign.rs
+++ b/openpgp/examples/sign.rs
@@ -5,6 +5,7 @@ use std::io;
extern crate openpgp;
use openpgp::armor;
+use openpgp::constants::DataFormat;
use openpgp::serialize::stream::{wrap, LiteralWriter, Signer};
fn main() {
@@ -37,7 +38,7 @@ fn main() {
// Then, create a literal writer to wrap the data in a literal
// message packet.
- let mut literal = LiteralWriter::new(signer, 'b', None, None)
+ let mut literal = LiteralWriter::new(signer, DataFormat::Binary, None, None)
.expect("Failed to create literal writer");
// Finally, just copy all the data.