Enum magic_crypt::MagicCrypt [−][src]
pub enum MagicCrypt { AES(MagicCryptAES), DES(MagicCryptDES), }
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 Read
) -> Result<String, Error>
[src]
pub fn encrypt_reader_to_base64(
&mut self,
reader: &mut Read
) -> Result<String, Error>
pub fn encrypt_reader_to_bytes(
&mut self,
reader: &mut Read
) -> Result<Vec<u8>, Error>
[src]
pub fn encrypt_reader_to_bytes(
&mut self,
reader: &mut Read
) -> Result<Vec<u8>, Error>
pub fn encrypt_reader_to_writer(
&mut self,
reader: &mut Read,
writer: &mut Write
) -> Result<(), Error>
[src]
pub fn encrypt_reader_to_writer(
&mut self,
reader: &mut Read,
writer: &mut 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 Read
) -> Result<Vec<u8>, Error>
[src]
pub fn decrypt_reader_to_bytes(
&mut self,
reader: &mut Read
) -> Result<Vec<u8>, Error>
pub fn decrypt_reader_to_writer(
&mut self,
reader: &mut Read,
writer: &mut Write
) -> Result<(), Error>
[src]
pub fn decrypt_reader_to_writer(
&mut self,
reader: &mut Read,
writer: &mut Write
) -> Result<(), Error>
Auto Trait Implementations
impl !Send for MagicCrypt
impl !Send for MagicCrypt
impl !Sync for MagicCrypt
impl !Sync for MagicCrypt