Struct rustls::crypto::cipher::InboundOpaqueMessage
source · pub struct InboundOpaqueMessage<'a> {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: BorrowedPayload<'a>,
}
Expand description
A TLS frame, named TLSPlaintext in the standard.
This inbound type borrows its encrypted payload from a buffer elsewhere. It is used for joining and is consumed by decryption.
Fields§
§typ: ContentType
§version: ProtocolVersion
§payload: BorrowedPayload<'a>
Implementations§
source§impl<'a> InboundOpaqueMessage<'a>
impl<'a> InboundOpaqueMessage<'a>
sourcepub fn new(
typ: ContentType,
version: ProtocolVersion,
payload: &'a mut [u8],
) -> Self
pub fn new( typ: ContentType, version: ProtocolVersion, payload: &'a mut [u8], ) -> Self
Construct a new InboundOpaqueMessage
from constituent fields.
payload
is borrowed.
sourcepub fn into_plain_message(self) -> InboundPlainMessage<'a>
pub fn into_plain_message(self) -> InboundPlainMessage<'a>
Force conversion into a plaintext message.
This should only be used for messages that are known to be in plaintext. Otherwise, the
InboundOpaqueMessage
should be decrypted into a PlainMessage
using a MessageDecrypter
.
sourcepub fn into_tls13_unpadded_message(
self,
) -> Result<InboundPlainMessage<'a>, Error>
pub fn into_tls13_unpadded_message( self, ) -> Result<InboundPlainMessage<'a>, Error>
For TLS1.3 (only), checks the length msg.payload is valid and removes the padding.
Returns an error if the message (pre-unpadding) is too long, or the padding is invalid, or the message (post-unpadding) is too long.
Auto Trait Implementations§
impl<'a> Freeze for InboundOpaqueMessage<'a>
impl<'a> RefUnwindSafe for InboundOpaqueMessage<'a>
impl<'a> Send for InboundOpaqueMessage<'a>
impl<'a> Sync for InboundOpaqueMessage<'a>
impl<'a> Unpin for InboundOpaqueMessage<'a>
impl<'a> !UnwindSafe for InboundOpaqueMessage<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more