[−][src]Enum magic_crypt::MagicCrypt
This enum of structs can help you encrypt or decrypt data in a quick way.
Variants
AES(MagicCryptAES)
DES(MagicCryptDES)
Methods
impl MagicCrypt
[src]
pub fn new<S: AsRef<str>, V: AsRef<str>>(
key: S,
bit: SecureBit,
iv: Option<V>
) -> MagicCrypt
[src]
key: S,
bit: SecureBit,
iv: Option<V>
) -> MagicCrypt
Create a new MagicCrypt instance. You may want to use new_magic_crypt!
macro.
pub fn encrypt_str_to_base64<S: AsRef<str>>(&mut self, string: S) -> String
[src]
pub fn encrypt_str_to_bytes<S: AsRef<str>>(&mut self, string: S) -> Vec<u8>
[src]
pub fn encrypt_bytes_to_base64<T: ?Sized + AsRef<[u8]>>(
&mut self,
bytes: &T
) -> String
[src]
&mut self,
bytes: &T
) -> String
pub fn encrypt_bytes_to_bytes<T: ?Sized + AsRef<[u8]>>(
&mut self,
bytes: &T
) -> Vec<u8>
[src]
&mut self,
bytes: &T
) -> Vec<u8>
pub fn encrypt_to_base64<T: ?Sized + AsRef<[u8]>>(&mut self, data: &T) -> String
[src]
pub fn encrypt_to_bytes<T: ?Sized + AsRef<[u8]>>(&mut self, data: &T) -> Vec<u8>
[src]
pub fn encrypt_reader_to_base64(
&mut self,
reader: &mut dyn Read
) -> Result<String, Error>
[src]
&mut self,
reader: &mut dyn Read
) -> Result<String, Error>
pub fn encrypt_reader_to_bytes(
&mut self,
reader: &mut dyn Read
) -> Result<Vec<u8>, Error>
[src]
&mut self,
reader: &mut dyn Read
) -> Result<Vec<u8>, Error>
pub fn encrypt_reader_to_writer(
&mut self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), Error>
[src]
&mut self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), Error>
pub fn decrypt_base64_to_string<S: AsRef<str>>(
&mut self,
base64: S
) -> Result<String, Error>
[src]
&mut self,
base64: S
) -> Result<String, Error>
pub fn decrypt_base64_to_bytes<S: AsRef<str>>(
&mut self,
base64: S
) -> Result<Vec<u8>, Error>
[src]
&mut self,
base64: S
) -> Result<Vec<u8>, Error>
pub fn decrypt_bytes_to_string<T: ?Sized + AsRef<[u8]>>(
&mut self,
bytes: &T
) -> Result<String, Error>
[src]
&mut self,
bytes: &T
) -> Result<String, Error>
pub fn decrypt_bytes_to_bytes<T: ?Sized + AsRef<[u8]>>(
&mut self,
bytes: &T
) -> Result<Vec<u8>, Error>
[src]
&mut self,
bytes: &T
) -> Result<Vec<u8>, Error>
pub fn decrypt_reader_to_bytes(
&mut self,
reader: &mut dyn Read
) -> Result<Vec<u8>, Error>
[src]
&mut self,
reader: &mut dyn Read
) -> Result<Vec<u8>, Error>
pub fn decrypt_reader_to_writer(
&mut self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), Error>
[src]
&mut self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), Error>
Auto Trait Implementations
impl !RefUnwindSafe for MagicCrypt
impl !Send for MagicCrypt
impl !Sync for MagicCrypt
impl Unpin for MagicCrypt
impl !UnwindSafe for MagicCrypt
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,