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§
sourcefn encrypt(
&mut self,
msg: BorrowedPlainMessage<'_>,
seq: u64,
) -> Result<OpaqueMessage, Error>
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`].
sourcefn encrypted_payload_len(&self, payload_len: usize) -> usize
fn encrypted_payload_len(&self, payload_len: usize) -> usize
Return the length of the ciphertext that results from encrypting plaintext of
length payload_len