pub struct RecordLayer {
    message_encrypter: Box<dyn MessageEncrypter>,
    message_decrypter: Box<dyn MessageDecrypter>,
    write_seq: u64,
    read_seq: u64,
    encrypt_state: DirectionState,
    decrypt_state: DirectionState,
    trial_decryption_len: Option<usize>,
}

Fields§

§message_encrypter: Box<dyn MessageEncrypter>§message_decrypter: Box<dyn MessageDecrypter>§write_seq: u64§read_seq: u64§encrypt_state: DirectionState§decrypt_state: DirectionState§trial_decryption_len: Option<usize>

Implementations§

Prepare to use the given MessageEncrypter for future message encryption. It is not used until you call start_encrypting.

Prepare to use the given MessageDecrypter for future message decryption. It is not used until you call start_decrypting.

Start using the MessageEncrypter previously provided to the previous call to prepare_message_encrypter.

Start using the MessageDecrypter previously provided to the previous call to prepare_message_decrypter.

Set and start using the given MessageEncrypter for future outgoing message encryption.

Set and start using the given MessageDecrypter for future incoming message decryption.

Set and start using the given MessageDecrypter for future incoming message decryption, and enable “trial decryption” mode for when TLS1.3 0-RTT is attempted but rejected by the server.

Return true if the peer appears to getting close to encrypting too many messages with this key.

Perhaps if we send an alert well before their counter wraps, a buggy peer won’t make a terrible mistake here?

Note that there’s no reason to refuse to decrypt: the security failure has already happened.

Return true if we are getting close to encrypting too many messages with our encryption key.

Return true if we outright refuse to do anything with the encryption key.

Decrypt a TLS message.

encr is a decoded message allegedly received from the peer. If it can be decrypted, its decryption is returned. Otherwise, an error is returned.

Encrypt a TLS message.

plain is a TLS message we’d like to send. This function panics if the requisite keying material hasn’t been established yet.

Trait Implementations§

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The Resulting [TupleList], of an [Prepend::prepend()] call, including the prepended entry.
Prepend a value to this tuple, returning a new tuple with prepended value.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.