pub struct MagicCrypt256 { /* private fields */ }Expand description
This struct can help you encrypt or decrypt data via AES-256 in a quick way.
Trait Implementations§
Source§impl Clone for MagicCrypt256
impl Clone for MagicCrypt256
Source§impl Debug for MagicCrypt256
impl Debug for MagicCrypt256
Source§impl Drop for MagicCrypt256
impl Drop for MagicCrypt256
Source§impl MagicCryptTrait for MagicCrypt256
impl MagicCryptTrait for MagicCrypt256
fn new<S: AsRef<[u8]>, V: AsRef<[u8]>>(key: S, iv: Option<V>) -> MagicCrypt256
fn encrypt_to_bytes<T: ?Sized + AsRef<[u8]>>(&self, data: &T) -> Vec<u8> ⓘ
Source§fn encrypt_reader_to_bytes(
&self,
reader: &mut dyn Read,
) -> Result<Vec<u8>, MagicCryptError>
fn encrypt_reader_to_bytes( &self, reader: &mut dyn Read, ) -> Result<Vec<u8>, MagicCryptError>
Read all input into memory and return its encrypted bytes.
Source§fn encrypt_reader_to_writer2<N: ArraySize + PartialDiv<U16> + IsGreaterOrEqual<U16, Output = True>>(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write,
) -> Result<(), MagicCryptError>
fn encrypt_reader_to_writer2<N: ArraySize + PartialDiv<U16> + IsGreaterOrEqual<U16, Output = True>>( &self, reader: &mut dyn Read, writer: &mut dyn Write, ) -> Result<(), MagicCryptError>
Encrypt data in chunks with a buffer of
N bytes and flush the writer on success. Read morefn decrypt_bytes_to_bytes<T: ?Sized + AsRef<[u8]>>( &self, bytes: &T, ) -> Result<Vec<u8>, MagicCryptError>
Source§fn decrypt_reader_to_bytes(
&self,
reader: &mut dyn Read,
) -> Result<Vec<u8>, MagicCryptError>
fn decrypt_reader_to_bytes( &self, reader: &mut dyn Read, ) -> Result<Vec<u8>, MagicCryptError>
Read all input into memory and return its decrypted bytes.
Source§fn decrypt_reader_to_writer2<N: ArraySize + PartialDiv<U16> + IsGreaterOrEqual<U16, Output = True>>(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write,
) -> Result<(), MagicCryptError>
fn decrypt_reader_to_writer2<N: ArraySize + PartialDiv<U16> + IsGreaterOrEqual<U16, Output = True>>( &self, reader: &mut dyn Read, writer: &mut dyn Write, ) -> Result<(), MagicCryptError>
Decrypt data in chunks with a buffer of
N bytes and flush the writer on success. Read morefn encrypt_str_to_base64<S: AsRef<str>>(&self, string: S) -> String
fn encrypt_str_to_bytes<S: AsRef<str>>(&self, string: S) -> Vec<u8> ⓘ
fn encrypt_bytes_to_base64<T: ?Sized + AsRef<[u8]>>(&self, bytes: &T) -> String
fn encrypt_bytes_to_bytes<T: ?Sized + AsRef<[u8]>>(&self, bytes: &T) -> Vec<u8> ⓘ
fn encrypt_to_base64<T: ?Sized + AsRef<[u8]>>(&self, data: &T) -> String
Source§fn encrypt_reader_to_base64(
&self,
reader: &mut dyn Read,
) -> Result<String, MagicCryptError>
fn encrypt_reader_to_base64( &self, reader: &mut dyn Read, ) -> Result<String, MagicCryptError>
Read all input into memory and return its encrypted data as Base64.
Source§fn encrypt_reader_to_writer(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write,
) -> Result<(), MagicCryptError>
fn encrypt_reader_to_writer( &self, reader: &mut dyn Read, writer: &mut dyn Write, ) -> Result<(), MagicCryptError>
Encrypt data in chunks with a 4096-byte buffer and flush the writer on success. Read more
fn decrypt_base64_to_string<S: AsRef<str>>( &self, base64: S, ) -> Result<String, MagicCryptError>
fn decrypt_base64_to_bytes<S: AsRef<str>>( &self, base64: S, ) -> Result<Vec<u8>, MagicCryptError>
Source§fn decrypt_reader_to_writer(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write,
) -> Result<(), MagicCryptError>
fn decrypt_reader_to_writer( &self, reader: &mut dyn Read, writer: &mut dyn Write, ) -> Result<(), MagicCryptError>
Decrypt data in chunks with a 4096-byte buffer and flush the writer on success. Read more
Auto Trait Implementations§
impl Freeze for MagicCrypt256
impl RefUnwindSafe for MagicCrypt256
impl Send for MagicCrypt256
impl Sync for MagicCrypt256
impl Unpin for MagicCrypt256
impl UnsafeUnpin for MagicCrypt256
impl UnwindSafe for MagicCrypt256
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