pub struct Encryptor { /* private fields */ }Available on crate features
aes-cbc or aes-ctr or tdes only.Expand description
Stateful encryptor object for unauthenticated SSH symmetric ciphers.
Note that this deliberately does not support AEAD modes such as AES-GCM and ChaCha20Poly1305, which are one-shot by design.
Implementations§
Source§impl Encryptor
impl Encryptor
Sourcepub fn new(cipher: Cipher, key: &[u8], iv: &[u8]) -> Result<Self>
pub fn new(cipher: Cipher, key: &[u8], iv: &[u8]) -> Result<Self>
Create a new encryptor object with the given Cipher, key, and iv (i.e.
initialization vector).
§Errors
- Returns
Error::Lengthifkeyorivare the wrong length for the givencipher. - Returns
Error::UnsupportedCipherif support for the givencipheris not enabled in the crate features.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encryptor
impl RefUnwindSafe for Encryptor
impl Send for Encryptor
impl Sync for Encryptor
impl Unpin for Encryptor
impl UnsafeUnpin for Encryptor
impl UnwindSafe for Encryptor
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