EncryptedFile

Struct EncryptedFile 

Source
pub struct EncryptedFile { /* private fields */ }
Expand description

TODO checking file sizes Update add_file_digest when cheking stream size will be stable unwraps to expect

Implementations§

Source§

impl EncryptedFile

Source

pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>

Source

pub fn zip_file_options(&self) -> &FileOptions

Source

pub fn set_zip_file_options(&mut self, file_options: FileOptions)

Source

pub fn associated_data(&self) -> &[u8]

Source

pub fn change_associated_data(&mut self, associated_data: Vec<u8>)

Source

pub fn change_buffor_size(&mut self, buffor_size: usize)

Source

pub fn buffor_size(&self) -> usize

Source

pub fn get_directory_content_soft(&self) -> Option<&DirectoryContent>

Source

pub fn get_directory_content( &mut self, ) -> EncryptedFileResult<&DirectoryContent>

Source

pub fn get_directory_content_hard( &mut self, ) -> EncryptedFileResult<&DirectoryContent>

Source

pub fn add_file<I: Read>( &mut self, src: I, dst_path: &DirectoryContentPath, public_key: &PublicKey, ) -> EncryptedFileResult<()>

Source

pub fn add_file_and_sign<I: Read>( &mut self, src: I, dst_path: &DirectoryContentPath, public_key: &PublicKey, private_key: &RsaPrivateKey, ) -> EncryptedFileResult<()>

Source

pub fn decrypt_file<O: Write>( &self, src: &DirectoryContentPath, dst: O, private_key: &PrivateKey, ) -> DecryptFileResult

Source

pub fn decrypt_file_and_verify<O: Write>( &self, src: &DirectoryContentPath, dst: O, private_key: &PrivateKey, public_key: &RsaPublicKey, ) -> DecryptFileAndVerifyResult

Source

pub fn add_directory<P: AsRef<Path>>( &mut self, src: P, dst: DirectoryContentPath, public_key: &PublicKey, ) -> EncryptedFileResult<Vec<(Box<Path>, EncryptedFileResult<()>)>>

Source

pub fn add_directory_callback<P, B, E, A>( &mut self, src: P, dst: DirectoryContentPath, public_key: &PublicKey, before: B, callback: E, after: A, ) -> EncryptedFileResult<Vec<(Box<Path>, EncryptedFileResult<()>)>>

Source

pub fn add_directory_and_sign<P: AsRef<Path>>( &mut self, src: P, dst: DirectoryContentPath, public_key: &PublicKey, private_key: &RsaPrivateKey, ) -> EncryptedFileResult<Vec<(Box<Path>, EncryptedFileResult<()>)>>

Source

pub fn add_directory_and_sign_callback<P, B, E, A>( &mut self, src: P, dst: DirectoryContentPath, public_key: &PublicKey, private_key: &RsaPrivateKey, before: B, callback: E, after: A, ) -> EncryptedFileResult<Vec<(Box<Path>, EncryptedFileResult<()>)>>

Source

pub fn decrypt_directory<P: AsRef<Path>>( &self, src: DirectoryContentPath, dst: P, private_key: &PrivateKey, ) -> EncryptedFileResult<Vec<(String, DecryptFileResult)>>

Source

pub fn decrypt_directory_callback<P, B, E, A>( &self, src: DirectoryContentPath, dst: P, private_key: &PrivateKey, before: B, callback: E, after: A, ) -> EncryptedFileResult<Vec<(String, DecryptFileResult)>>

Source

pub fn decrypt_directory_and_verify<P: AsRef<Path>>( &self, src: DirectoryContentPath, dst: P, private_key: &PrivateKey, public_key: &RsaPublicKey, ) -> EncryptedFileResult<Vec<(String, DecryptFileAndVerifyResult)>>

Source

pub fn decrypt_directory_and_verify_callback<P, B, E, A>( &self, src: DirectoryContentPath, dst: P, private_key: &PrivateKey, public_key: &RsaPublicKey, before: B, callback: E, after: A, ) -> EncryptedFileResult<Vec<(String, DecryptFileAndVerifyResult)>>

Source

pub fn delete_path<O: Write + Seek>( &self, output: O, to_delete: &Vec<DirectoryContentPath>, ) -> EncryptedFileResult<()>

Auto Trait Implementations§

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V