pub struct Cryptor { /* private fields */ }Expand description
A cryptor supporting all of the block and stream ciphers provided by the common crypto library.
let config = Config::RC4 { key: b"Key" };
assert_eq!(
Cryptor::encrypt(&config, b"Plaintext").unwrap(),
&[0xbb, 0xf3, 0x16, 0xe8, 0xd9, 0x40, 0xaf, 0x0a, 0xd3]
);Implementations§
Source§impl Cryptor
impl Cryptor
pub fn new_encryptor<'a>(config: &Config<'a>) -> Result<Self, CryptorError>
pub fn new_decryptor<'a>(config: &Config<'a>) -> Result<Self, CryptorError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cryptor
impl RefUnwindSafe for Cryptor
impl !Send for Cryptor
impl !Sync for Cryptor
impl Unpin for Cryptor
impl UnwindSafe for Cryptor
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