SEIP2

Struct SEIP2 

Source
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

Source

pub fn new( sym_algo: SymmetricAlgorithm, aead: AEADAlgorithm, chunk_size: u64, salt: [u8; 32], ) -> Result<Self>

Creates a new SEIP2 packet.

Source

pub fn symmetric_algo(&self) -> SymmetricAlgorithm

Gets the symmetric algorithm.

Source

pub fn set_symmetric_algo( &mut self, sym_algo: SymmetricAlgorithm, ) -> SymmetricAlgorithm

Sets the symmetric algorithm.

Source

pub fn aead(&self) -> AEADAlgorithm

Gets the AEAD algorithm.

Source

pub fn set_aead(&mut self, aead: AEADAlgorithm) -> AEADAlgorithm

Sets the AEAD algorithm.

Source

pub fn chunk_size(&self) -> u64

Gets the chunk size.

Source

pub fn set_chunk_size(&mut self, chunk_size: u64) -> Result<()>

Sets the chunk size.

Source

pub fn chunk_digest_size(&self) -> Result<u64>

Gets the size of a chunk with a digest.

Source

pub fn salt(&self) -> &[u8; 32]

Gets the salt.

Source

pub fn set_salt(&mut self, salt: [u8; 32]) -> [u8; 32]

Sets the salt.

Source§

impl SEIP2

This packet implements the processed container interface.

Container packets like this one can contain either unprocessed or processed, structured data.

Source

pub fn container_ref(&self) -> &Container

Returns a reference to the container.

Source

pub fn container_mut(&mut self) -> &mut Container

Returns a mutable reference to the container.

Source

pub fn body(&self) -> &Body

Gets a reference to the this packet’s body.

Source

pub fn set_body(&mut self, body: Body) -> Body

Sets the this packet’s body.

Trait Implementations§

Source§

impl Clone for SEIP2

Source§

fn clone(&self) -> SEIP2

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SEIP2

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<SEIP2> for Packet

Source§

fn from(s: SEIP2) -> Self

Converts to this type from the input type.
Source§

impl From<SEIP2> for SEIP

Source§

fn from(p: SEIP2) -> Self

Converts to this type from the input type.
Source§

impl Hash for SEIP2

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Marshal for SEIP2

Source§

fn serialize(&self, o: &mut dyn Write) -> Result<()>

Writes a serialized version of the specified SEIPv2 packet to o.

§Errors

Returns Error::InvalidOperation if this packet has children. To construct an encrypted message, use serialize::stream::Encryptor.

Source§

fn export(&self, o: &mut dyn Write) -> Result<()>

Exports a serialized version of the object to o. Read more
Source§

impl MarshalInto for SEIP2

Source§

fn serialized_len(&self) -> usize

Computes the maximal length of the serialized representation. Read more
Source§

fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>

Serializes into the given buffer. Read more
Source§

fn to_vec(&self) -> Result<Vec<u8>>

Serializes the packet to a vector.
Source§

fn export_into(&self, buf: &mut [u8]) -> Result<usize>

Exports into the given buffer. Read more
Source§

fn export_to_vec(&self) -> Result<Vec<u8>>

Exports to a vector. Read more
Source§

impl PartialEq for SEIP2

Source§

fn eq(&self, other: &SEIP2) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for SEIP2

Source§

impl StructuralPartialEq for SEIP2

Auto Trait Implementations§

§

impl Freeze for SEIP2

§

impl RefUnwindSafe for SEIP2

§

impl Send for SEIP2

§

impl Sync for SEIP2

§

impl Unpin for SEIP2

§

impl UnwindSafe for SEIP2

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T