Trait rustls::crypto::cipher::MessageEncrypter

source ·
pub trait MessageEncrypter: Send + Sync {
    // Required methods
    fn encrypt(
        &mut self,
        msg: BorrowedPlainMessage<'_>,
        seq: u64
    ) -> Result<OpaqueMessage, 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: BorrowedPlainMessage<'_>, seq: u64 ) -> Result<OpaqueMessage, 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§