diff options
Diffstat (limited to 'openpgp/examples')
-rw-r--r-- | openpgp/examples/generate-encrypt-decrypt.rs | 4 | ||||
-rw-r--r-- | openpgp/examples/generate-sign-verify.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/openpgp/examples/generate-encrypt-decrypt.rs b/openpgp/examples/generate-encrypt-decrypt.rs index 90640ba3..f24eba1f 100644 --- a/openpgp/examples/generate-encrypt-decrypt.rs +++ b/openpgp/examples/generate-encrypt-decrypt.rs @@ -38,7 +38,7 @@ fn generate() -> openpgp::Result<openpgp::TPK> { } /// Encrypts the given message. -fn encrypt(sink: &mut Write, plaintext: &str, recipient: &openpgp::TPK) +fn encrypt(sink: &mut dyn Write, plaintext: &str, recipient: &openpgp::TPK) -> openpgp::Result<()> { // Build a vector of recipients to hand to Encryptor. let recipients = @@ -72,7 +72,7 @@ fn encrypt(sink: &mut Write, plaintext: &str, recipient: &openpgp::TPK) } /// Decrypts the given message. -fn decrypt(sink: &mut Write, ciphertext: &[u8], recipient: &openpgp::TPK) +fn decrypt(sink: &mut dyn Write, ciphertext: &[u8], recipient: &openpgp::TPK) -> openpgp::Result<()> { // Make a helper that that feeds the recipient's secret key to the // decryptor. diff --git a/openpgp/examples/generate-sign-verify.rs b/openpgp/examples/generate-sign-verify.rs index 8625e4ea..8dae191c 100644 --- a/openpgp/examples/generate-sign-verify.rs +++ b/openpgp/examples/generate-sign-verify.rs @@ -37,7 +37,7 @@ fn generate() -> openpgp::Result<openpgp::TPK> { } /// Signs the given message. -fn sign(sink: &mut Write, plaintext: &str, tsk: &openpgp::TPK) +fn sign(sink: &mut dyn Write, plaintext: &str, tsk: &openpgp::TPK) -> openpgp::Result<()> { // Get the keypair to do the signing from the TPK. let mut keypair = tsk.keys_valid().signing_capable().nth(0).unwrap().2 @@ -63,7 +63,7 @@ fn sign(sink: &mut Write, plaintext: &str, tsk: &openpgp::TPK) } /// Verifies the given message. -fn verify(sink: &mut Write, signed_message: &[u8], sender: &openpgp::TPK) +fn verify(sink: &mut dyn Write, signed_message: &[u8], sender: &openpgp::TPK) -> openpgp::Result<()> { // Make a helper that that feeds the sender's public key to the // verifier. |