pub struct ChannelBinding { /* private fields */ }Expand description
A parsed TLS channel binding: the RFC 9266 tls-exporter keying material
for one connection.
Parse, don’t validate: the only way to hold a ChannelBinding is through
ChannelBinding::from_exporter, which enforces the length. Downstream
code (the envelope key derivation) can therefore trust the bytes without
re-checking. Two ChannelBindings compare equal iff their exporter bytes
match — i.e. iff they came from the same TLS connection. The comparison
is constant-time so a relay attacker learns nothing from timing.
Implementations§
Source§impl ChannelBinding
impl ChannelBinding
Sourcepub fn from_exporter(material: &[u8]) -> Result<Self, ChannelBindingError>
pub fn from_exporter(material: &[u8]) -> Result<Self, ChannelBindingError>
Parse raw TLS exporter material into a channel binding.
material MUST be the keying material a TLS stack exported under
TLS_EXPORTER_LABEL with an absent context and length
TLS_EXPORTER_LEN — see the module docs for the normative
parameters. Any other length is rejected so an invalid binding is
unrepresentable past this boundary.
Trait Implementations§
Source§impl Clone for ChannelBinding
impl Clone for ChannelBinding
Source§fn clone(&self) -> ChannelBinding
fn clone(&self) -> ChannelBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChannelBinding
impl Debug for ChannelBinding
impl Eq for ChannelBinding
Source§impl PartialEq for ChannelBinding
Constant-time equality: equal iff the two bindings come from the same TLS
connection. Constant-time so a relay attacker probing “is my forged binding
close to the real one?” learns nothing from response timing.
impl PartialEq for ChannelBinding
Constant-time equality: equal iff the two bindings come from the same TLS connection. Constant-time so a relay attacker probing “is my forged binding close to the real one?” learns nothing from response timing.
Auto Trait Implementations§
impl Freeze for ChannelBinding
impl RefUnwindSafe for ChannelBinding
impl Send for ChannelBinding
impl Sync for ChannelBinding
impl Unpin for ChannelBinding
impl UnsafeUnpin for ChannelBinding
impl UnwindSafe for ChannelBinding
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.