pub struct State {
pub peer_certificates: Vec<Vec<u8>>,
pub identity_hint: Vec<u8>,
/* private fields */
}Expand description
The negotiated connection state: keys, sequence numbers, peer identity and the active cipher suite.
Fields§
§peer_certificates: Vec<Vec<u8>>The peer’s certificate chain, DER-encoded.
WebRTC checks its fingerprint against the one signalled in SDP.
identity_hint: Vec<u8>The PSK identity hint, for pre-shared-key handshakes.
Implementations§
Source§impl State
impl State
Sourcepub fn init_cipher_suite(&mut self) -> Result<()>
pub fn init_cipher_suite(&mut self) -> Result<()>
Installs the negotiated keys into the cipher suite.
§Errors
Fails if the master secret or randoms are not yet available.
Sourcepub fn marshal_binary(&self) -> Result<Vec<u8>>
pub fn marshal_binary(&self) -> Result<Vec<u8>>
Serializes the state, so a connection can be resumed or migrated.
§Errors
Fails if the state is incomplete.
Sourcepub fn unmarshal_binary(&mut self, data: &[u8]) -> Result<()>
pub fn unmarshal_binary(&mut self, data: &[u8]) -> Result<()>
Restores state previously produced by Self::marshal_binary.
§Errors
Fails if data is truncated or malformed.
Sourcepub fn srtp_protection_profile(&self) -> SrtpProtectionProfile
pub fn srtp_protection_profile(&self) -> SrtpProtectionProfile
The SRTP protection profile negotiated through use_srtp.
Sourcepub fn cipher_suite(&self) -> Option<&dyn CipherSuite>
pub fn cipher_suite(&self) -> Option<&dyn CipherSuite>
The active cipher suite, once one has been negotiated.
Trait Implementations§
Source§impl KeyingMaterialExporter for State
impl KeyingMaterialExporter for State
Source§fn export_keying_material(
&self,
label: &str,
context: &[u8],
length: usize,
) -> Result<Vec<u8>>
fn export_keying_material( &self, label: &str, context: &[u8], length: usize, ) -> Result<Vec<u8>>
export_keying_material returns length bytes of exported key material in a new slice as defined in RFC 5705. This allows protocols to use DTLS for key establishment, but then use some of the keying material for their own purposes
Auto Trait Implementations§
impl !RefUnwindSafe for State
impl !UnwindSafe for State
impl Freeze for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.