pub struct SEIP2 { /* private fields */ }Expand description
Holds an encrypted data packet.
An encrypted data packet is a container. See Version 2 Symmetrically Encrypted and Integrity Protected Data Packet Format for details.
§A note on equality
An unprocessed (encrypted) SEIP2 packet is never considered equal
to a processed (decrypted) one. Likewise, a processed (decrypted)
packet is never considered equal to a structured (parsed) one.
Implementations§
Source§impl SEIP2
impl SEIP2
Sourcepub fn new(
sym_algo: SymmetricAlgorithm,
aead: AEADAlgorithm,
chunk_size: u64,
salt: [u8; 32],
) -> Result<Self>
pub fn new( sym_algo: SymmetricAlgorithm, aead: AEADAlgorithm, chunk_size: u64, salt: [u8; 32], ) -> Result<Self>
Creates a new SEIP2 packet.
Sourcepub fn symmetric_algo(&self) -> SymmetricAlgorithm
pub fn symmetric_algo(&self) -> SymmetricAlgorithm
Gets the symmetric algorithm.
Sourcepub fn set_symmetric_algo(
&mut self,
sym_algo: SymmetricAlgorithm,
) -> SymmetricAlgorithm
pub fn set_symmetric_algo( &mut self, sym_algo: SymmetricAlgorithm, ) -> SymmetricAlgorithm
Sets the symmetric algorithm.
Sourcepub fn aead(&self) -> AEADAlgorithm
pub fn aead(&self) -> AEADAlgorithm
Gets the AEAD algorithm.
Sourcepub fn set_aead(&mut self, aead: AEADAlgorithm) -> AEADAlgorithm
pub fn set_aead(&mut self, aead: AEADAlgorithm) -> AEADAlgorithm
Sets the AEAD algorithm.
Sourcepub fn chunk_size(&self) -> u64
pub fn chunk_size(&self) -> u64
Gets the chunk size.
Sourcepub fn set_chunk_size(&mut self, chunk_size: u64) -> Result<()>
pub fn set_chunk_size(&mut self, chunk_size: u64) -> Result<()>
Sets the chunk size.
Sourcepub fn chunk_digest_size(&self) -> Result<u64>
pub fn chunk_digest_size(&self) -> Result<u64>
Gets the size of a chunk with a digest.
Source§impl SEIP2
This packet implements the processed container
interface.
impl SEIP2
This packet implements the processed container interface.
Container packets like this one can contain either unprocessed or processed, structured data.
Sourcepub fn container_ref(&self) -> &Container
pub fn container_ref(&self) -> &Container
Returns a reference to the container.
Sourcepub fn container_mut(&mut self) -> &mut Container
pub fn container_mut(&mut self) -> &mut Container
Returns a mutable reference to the container.