Skip to main content

TlsExtension

Struct TlsExtension 

Source
pub struct TlsExtension<'a> { /* private fields */ }
Expand description

A raw TLS extension preserving its type and opaque payload.

Implementations§

Source§

impl<'a> TlsExtension<'a>

Source

pub fn quic_transport_parameters( &self, ) -> Result<QuicTransportParameters<'a>, QuicTransportParametersTlsExtensionError>

Parses this RFC 9001 QUIC transport-parameters extension payload.

RFC 9001 permits this extension in ClientHello and EncryptedExtensions and requires it in both. Callers that own the parent handshake-message context enforce its placement and presence; this accessor parses only the extension payload.

Source§

impl<'a> TlsExtension<'a>

Source

pub const fn extension_type(&self) -> TlsExtensionType

Returns the raw extension type.

Source

pub const fn data(&self) -> &'a [u8]

Returns the exact extension payload.

Source

pub fn client_server_name_list( &self, ) -> Result<ClientServerNameList<'a>, TlsParseError>

Parses the ClientHello server_name list layout.

Source

pub fn server_name_acknowledgement(&self) -> Result<(), TlsParseError>

Validates the empty ServerHello server_name acknowledgement.

Source

pub fn alpn_protocol_list(&self) -> Result<AlpnProtocolList<'a>, TlsParseError>

Parses an ordered ALPN protocol-name list.

Source

pub fn server_selected_alpn( &self, ) -> Result<ServerSelectedAlpn<'a>, TlsParseError>

Parses the single protocol selected by a server ALPN extension.

Source

pub fn client_supported_versions( &self, ) -> Result<ClientSupportedVersions<'a>, TlsParseError>

Parses the ClientHello supported_versions vector.

Source

pub fn server_supported_version( &self, ) -> Result<TlsProtocolVersion, TlsParseError>

Returns the selected server or HelloRetryRequest protocol version.

Source

pub fn server_supported_version_view( &self, ) -> Result<ServerSupportedVersion, TlsParseError>

Parses the server or HelloRetryRequest supported_versions layout.

Source

pub fn supported_groups(&self) -> Result<SupportedGroups<'a>, TlsParseError>

Parses the ordered supported named groups.

Source

pub fn signature_algorithms( &self, ) -> Result<SignatureAlgorithms<'a>, TlsParseError>

Parses the signature_algorithms scheme list.

Source

pub fn signature_algorithms_cert( &self, ) -> Result<SignatureAlgorithms<'a>, TlsParseError>

Parses the signature_algorithms_cert scheme list.

Source

pub fn ec_point_formats(&self) -> Result<EcPointFormats<'a>, TlsParseError>

Parses the legacy EC point-format list.

Source

pub fn client_key_share(&self) -> Result<ClientKeyShare<'a>, TlsParseError>

Parses the ClientHello key-share entry vector.

Source

pub fn server_key_share(&self) -> Result<ServerKeyShare<'a>, TlsParseError>

Parses the single ServerHello key-share entry.

Source

pub fn hrr_key_share(&self) -> Result<HrrKeyShare, TlsParseError>

Parses the selected HelloRetryRequest key-share group.

Source

pub fn psk_key_exchange_modes( &self, ) -> Result<PskKeyExchangeModes<'a>, TlsParseError>

Parses the ordered PSK key-exchange modes.

Source

pub fn client_pre_shared_key( &self, ) -> Result<ClientPreSharedKey<'a>, TlsParseError>

Parses ClientHello PSK identities and binders.

Source

pub fn server_pre_shared_key(&self) -> Result<ServerPreSharedKey, TlsParseError>

Parses the ServerHello selected PSK identity.

Source

pub fn certificate_compression_algorithms( &self, ) -> Result<CertificateCompressionAlgorithms<'a>, TlsParseError>

Parses the offered certificate-compression algorithms.

Source

pub fn cookie(&self) -> Result<Cookie<'a>, TlsParseError>

Parses the nonempty cookie vector.

Source

pub fn early_data_marker(&self) -> Result<(), TlsParseError>

Validates an empty ClientHello or EncryptedExtensions early_data marker.

Source

pub fn early_data_max_size(&self) -> Result<u32, TlsParseError>

Parses a NewSessionTicket maximum early-data size.

Trait Implementations§

Source§

impl<'a> Clone for TlsExtension<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for TlsExtension<'a>

Source§

impl<'a> Debug for TlsExtension<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for TlsExtension<'a>

Source§

impl<'a> PartialEq for TlsExtension<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for TlsExtension<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for TlsExtension<'a>

§

impl<'a> RefUnwindSafe for TlsExtension<'a>

§

impl<'a> Send for TlsExtension<'a>

§

impl<'a> Sync for TlsExtension<'a>

§

impl<'a> Unpin for TlsExtension<'a>

§

impl<'a> UnsafeUnpin for TlsExtension<'a>

§

impl<'a> UnwindSafe for TlsExtension<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.