rustls::crypto::cipher

Trait MessageEncrypter

Source
pub trait MessageEncrypter: Send + Sync {
    // Required methods
    fn encrypt(
        &mut self,
        msg: OutboundPlainMessage<'_>,
        seq: u64,
    ) -> Result<OutboundOpaqueMessage, Error>;
    fn encrypted_payload_len(&self, payload_len: usize) -> usize;
}
Expand description

Objects with this trait can encrypt TLS messages.

Required Methods§

Source

fn encrypt( &mut self, msg: OutboundPlainMessage<'_>, seq: u64, ) -> Result<OutboundOpaqueMessage, Error>

Encrypt the given TLS message msg, using the sequence number seq which can be used to derive a unique Nonce.

Source

fn encrypted_payload_len(&self, payload_len: usize) -> usize

Return the length of the ciphertext that results from encrypting plaintext of length payload_len

Implementors§