Struct webrtc_srtp::context::Context

source ·
pub struct Context { /* private fields */ }
Expand description

Context represents a SRTP cryptographic context Context can only be used for one-way operations it must either used ONLY for encryption or ONLY for decryption

Implementations§

source§

impl Context

source

pub fn decrypt_rtcp(&mut self, encrypted: &[u8]) -> Result<Bytes, Error>

DecryptRTCP decrypts a RTCP packet with an encrypted payload

source

pub fn encrypt_rtcp(&mut self, decrypted: &[u8]) -> Result<Bytes, Error>

EncryptRTCP marshals and encrypts an RTCP packet, writing to the dst buffer provided. If the dst buffer does not have the capacity to hold len(plaintext) + 14 bytes, a new one will be allocated and returned.

source§

impl Context

source

pub fn decrypt_rtp_with_header( &mut self, encrypted: &[u8], header: &Header ) -> Result<Bytes, Error>

source

pub fn decrypt_rtp(&mut self, encrypted: &[u8]) -> Result<Bytes, Error>

DecryptRTP decrypts a RTP packet with an encrypted payload

source

pub fn encrypt_rtp_with_header( &mut self, payload: &[u8], header: &Header ) -> Result<Bytes, Error>

source

pub fn encrypt_rtp(&mut self, plaintext: &[u8]) -> Result<Bytes, Error>

EncryptRTP marshals and encrypts an RTP packet, writing to the dst buffer provided. If the dst buffer does not have the capacity to hold len(plaintext) + 10 bytes, a new one will be allocated and returned.

source§

impl Context

source

pub fn new( master_key: &[u8], master_salt: &[u8], profile: ProtectionProfile, srtp_ctx_opt: Option<ContextOption>, srtcp_ctx_opt: Option<ContextOption> ) -> Result<Context, Error>

CreateContext creates a new SRTP Context

Auto Trait Implementations§

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> 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> Same for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V