Trait ssh_packet::Cipher

source ·
pub trait Cipher {
    type Err;

    // Required methods
    fn size(&self) -> usize;
    fn decrypt(&mut self, packet: Packet) -> Result<Vec<u8>, Self::Err>;
    fn encrypt(&mut self, payload: Vec<u8>) -> Result<Packet, Self::Err>;
}
Expand description

The cipher implemented to decrypt data from a Packet or encrypt data to Packet.

Required Associated Types§

source

type Err

The associated error which can be returned when encrypting or decrypting.

Required Methods§

source

fn size(&self) -> usize

The size of the Message Authentication Code for this Cipher, in bytes.

source

fn decrypt(&mut self, packet: Packet) -> Result<Vec<u8>, Self::Err>

Transform the Packet using the Cipher into it’s decrypted payload.

source

fn encrypt(&mut self, payload: Vec<u8>) -> Result<Packet, Self::Err>

Transform the payload into it’s encrypted Packet using the Cipher.

Implementors§