pub struct CryptoEngine { /* private fields */ }Expand description
Fallback encryption engine using XOR cipher For production E2EE, use matrix-sdk directly
Implementations§
Source§impl CryptoEngine
impl CryptoEngine
pub fn new(shared_secret: Vec<u8>) -> Self
pub async fn encrypt(&self, plaintext: &[u8]) -> Vec<u8> ⓘ
pub async fn decrypt(&self, ciphertext: &[u8]) -> Vec<u8> ⓘ
pub async fn encrypt_message(&self, plaintext: &str) -> String
pub async fn decrypt_message(&self, ciphertext: &str) -> Result<String>
Trait Implementations§
Source§impl Clone for CryptoEngine
impl Clone for CryptoEngine
Source§fn clone(&self) -> CryptoEngine
fn clone(&self) -> CryptoEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CryptoEngine
impl Debug for CryptoEngine
Source§impl Default for CryptoEngine
impl Default for CryptoEngine
Source§fn default() -> CryptoEngine
fn default() -> CryptoEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CryptoEngine
impl !RefUnwindSafe for CryptoEngine
impl Send for CryptoEngine
impl Sync for CryptoEngine
impl Unpin for CryptoEngine
impl UnsafeUnpin for CryptoEngine
impl !UnwindSafe for CryptoEngine
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