pub struct InboundOpaqueMessage<'a> {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: BorrowedPayload<'a>,
}展开描述
A TLS frame, named TLSPlaintext in 标准.
This inbound type borrows its encrypted payload 从 缓冲区 elsewhere. It is 用 用于 joining 并 is 已消耗 by decryption.
字段§
§typ: ContentType§version: ProtocolVersion§payload: BorrowedPayload<'a>实现§
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 新 InboundOpaqueMessage 从 constituent fields.
payload 是借用的。
Sourcepub fn into_plain_message(self) -> InboundPlainMessage<'a>
pub fn into_plain_message(self) -> InboundPlainMessage<'a>
强制转换为明文消息
This should only be 用 用于 messages that are known 到 be in 明文. Otherwise, the
InboundOpaqueMessage should be decrypted into 一个 PlainMessage using 一个 MessageDecrypter。
Sourcepub fn into_plain_message_range(
self,
range: Range<usize>,
) -> InboundPlainMessage<'a>
pub fn into_plain_message_range( self, range: Range<usize>, ) -> InboundPlainMessage<'a>
强制转换为明文消息
range restricts the resulting message: 此函数 panics if it is out of range 用于
底层 message payload.
This should only be 用 用于 messages that are known 到 be in 明文. Otherwise, the
InboundOpaqueMessage should be decrypted into 一个 PlainMessage using 一个 MessageDecrypter。
Sourcepub fn into_tls13_unpadded_message(
self,
) -> Result<InboundPlainMessage<'a>, Error>
pub fn into_tls13_unpadded_message( self, ) -> Result<InboundPlainMessage<'a>, Error>
For TLS 1.3 (only), checks the length msg.payload is valid 并 removes the padding.
Returns an error if the message (pre-unpadding) is too long, 或 the padding is invalid, 或 the message (post-unpadding) is too long.