pub struct StreamSealer { /* private fields */ }Expand description
Incremental encryption of one file’s content stream.
Implementations§
Source§impl StreamSealer
impl StreamSealer
Sourcepub fn begin(
metadata: &FileMetadata,
key: &SecureKey,
kdf_params: KeyDerivationParams,
salt: [u8; 16],
nonce_prefix: [u8; 16],
metadata_nonce: [u8; 24],
) -> Result<(FileHeader, StreamSealer), FileError>
pub fn begin( metadata: &FileMetadata, key: &SecureKey, kdf_params: KeyDerivationParams, salt: [u8; 16], nonce_prefix: [u8; 16], metadata_nonce: [u8; 24], ) -> Result<(FileHeader, StreamSealer), FileError>
Starts sealing a new v3 file: encrypts the metadata envelope, builds the header, and returns it together with the sealer for the content chunks. The caller supplies the derived key and fresh random salt/nonces, keeping this deterministic.
Sourcepub fn begin_with_chunk_size(
metadata: &FileMetadata,
key: &SecureKey,
kdf_params: KeyDerivationParams,
salt: [u8; 16],
nonce_prefix: [u8; 16],
metadata_nonce: [u8; 24],
chunk_size: u32,
) -> Result<(FileHeader, StreamSealer), FileError>
pub fn begin_with_chunk_size( metadata: &FileMetadata, key: &SecureKey, kdf_params: KeyDerivationParams, salt: [u8; 16], nonce_prefix: [u8; 16], metadata_nonce: [u8; 24], chunk_size: u32, ) -> Result<(FileHeader, StreamSealer), FileError>
StreamSealer::begin with an explicit chunk size, for callers with
unusual chunking needs. The size must satisfy the same bounds the
header enforces.
Sourcepub fn chunk_plaintext_len(&self) -> usize
pub fn chunk_plaintext_len(&self) -> usize
Plaintext bytes to feed per StreamSealer::seal_chunk call; only
the final chunk may be shorter.
Auto Trait Implementations§
impl Freeze for StreamSealer
impl RefUnwindSafe for StreamSealer
impl Send for StreamSealer
impl Sync for StreamSealer
impl Unpin for StreamSealer
impl UnsafeUnpin for StreamSealer
impl UnwindSafe for StreamSealer
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