neosmart / cryptostream

Read and Write stream adapters for on-the-fly encryption and decryption for rust
https://neosmart.net/blog/2018/transparent-encryption-and-decryption-in-rust-with-cryptostreams/
Other
23 stars 6 forks source link

Encryptor/Decryptor: add new functions to convert into inner streams (std::io::Write) #4

Closed ghost closed 5 years ago

ghost commented 5 years ago

Could you add new functions to Encryptor/Decryptor which convert themselves into their inner streams?

In Rust way, it could be into_inner(self). But I would suggest to use this one:

pub fn finish(self) -> Result<W>;

Inside the functions, they will try to flush() the streams.

Thank you,

mqudsi commented 5 years ago

Good idea.

mqudsi commented 5 years ago

This was ultimately implemented in 6ba6bddf7e3919a7b8317389b4be2633ac3522da and should make it to the next release soon.