pub struct StreamOpener { /* private fields */ }Expand description
Incremental decryption of one file’s content stream.
Implementations§
Source§impl StreamOpener
impl StreamOpener
pub fn new(header: &FileHeader, key: &SecureKey) -> StreamOpener
Sourcepub fn chunk_ciphertext_len(&self) -> usize
pub fn chunk_ciphertext_len(&self) -> usize
Ciphertext bytes to feed per StreamOpener::open_chunk call; only
the final chunk may be shorter.
Sourcepub fn open_chunk(
&mut self,
ciphertext: &[u8],
is_last: bool,
) -> Result<SecureBytes, FileError>
pub fn open_chunk( &mut self, ciphertext: &[u8], is_last: bool, ) -> Result<SecureBytes, FileError>
Opens the next chunk. is_last marks that no more ciphertext
follows; sealing and opening must agree on which chunk is final or
authentication fails (this is what detects truncation).
Auto Trait Implementations§
impl Freeze for StreamOpener
impl RefUnwindSafe for StreamOpener
impl Send for StreamOpener
impl Sync for StreamOpener
impl Unpin for StreamOpener
impl UnsafeUnpin for StreamOpener
impl UnwindSafe for StreamOpener
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more