[−][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]
impl MagicCrypt
pub fn new(key: &str, bit: SecureBit, iv: Option<&str>) -> MagicCrypt
[src]
pub fn new(key: &str, bit: SecureBit, iv: Option<&str>) -> MagicCrypt
Create a new MagicCrypt instance. You may want to use new_magic_crypt!
macro.
pub fn encrypt_str_to_base64(&mut self, string: &str) -> String
[src]
pub fn encrypt_str_to_base64(&mut self, string: &str) -> String
pub fn encrypt_str_to_bytes(&mut self, string: &str) -> Vec<u8>
[src]
pub fn encrypt_str_to_bytes(&mut self, string: &str) -> Vec<u8>
pub fn encrypt_bytes_to_base64(&mut self, bytes: &[u8]) -> String
[src]
pub fn encrypt_bytes_to_base64(&mut self, bytes: &[u8]) -> String
pub fn encrypt_bytes_to_bytes(&mut self, bytes: &[u8]) -> Vec<u8>
[src]
pub fn encrypt_bytes_to_bytes(&mut self, bytes: &[u8]) -> Vec<u8>
pub fn encrypt_to_base64<T: ?Sized + AsRef<[u8]>>(&mut self, data: &T) -> String
[src]
pub fn encrypt_to_base64<T: ?Sized + AsRef<[u8]>>(&mut self, data: &T) -> String
pub fn encrypt_to_bytes<T: ?Sized + AsRef<[u8]>>(&mut self, data: &T) -> Vec<u8>
[src]
pub fn encrypt_to_bytes<T: ?Sized + AsRef<[u8]>>(&mut self, data: &T) -> Vec<u8>
pub fn encrypt_reader_to_base64(
&mut self,
reader: &mut dyn Read
) -> Result<String, Error>
[src]
pub fn encrypt_reader_to_base64(
&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]
pub fn encrypt_reader_to_bytes(
&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]
pub fn encrypt_reader_to_writer(
&mut self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), Error>
pub fn decrypt_base64_to_string(
&mut self,
base64: &str
) -> Result<String, Error>
[src]
pub fn decrypt_base64_to_string(
&mut self,
base64: &str
) -> Result<String, Error>
pub fn decrypt_base64_to_bytes(
&mut self,
base64: &str
) -> Result<Vec<u8>, Error>
[src]
pub fn decrypt_base64_to_bytes(
&mut self,
base64: &str
) -> Result<Vec<u8>, Error>
pub fn decrypt_bytes_to_string(&mut self, bytes: &[u8]) -> Result<String, Error>
[src]
pub fn decrypt_bytes_to_string(&mut self, bytes: &[u8]) -> Result<String, Error>
pub fn decrypt_bytes_to_bytes(&mut self, bytes: &[u8]) -> Result<Vec<u8>, Error>
[src]
pub fn decrypt_bytes_to_bytes(&mut self, bytes: &[u8]) -> Result<Vec<u8>, Error>
pub fn decrypt_reader_to_bytes(
&mut self,
reader: &mut dyn Read
) -> Result<Vec<u8>, Error>
[src]
pub fn decrypt_reader_to_bytes(
&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]
pub fn decrypt_reader_to_writer(
&mut self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), Error>
Auto Trait Implementations
impl !Send for MagicCrypt
impl !Send for MagicCrypt
impl !Sync for MagicCrypt
impl !Sync for MagicCrypt
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
🔬 This is a nightly-only experimental API. (
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
🔬 This is a nightly-only experimental API. (
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self