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
impl Context
Sourcepub fn decrypt_rtcp(&mut self, encrypted: &[u8]) -> Result<BytesMut>
pub fn decrypt_rtcp(&mut self, encrypted: &[u8]) -> Result<BytesMut>
DecryptRTCP decrypts a RTCP packet with an encrypted payload
Sourcepub fn encrypt_rtcp(&mut self, decrypted: &[u8]) -> Result<BytesMut>
pub fn encrypt_rtcp(&mut self, decrypted: &[u8]) -> Result<BytesMut>
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
impl Context
pub fn decrypt_rtp_with_header( &mut self, encrypted: &[u8], header: &Header, ) -> Result<BytesMut>
Sourcepub fn decrypt_rtp(&mut self, encrypted: &[u8]) -> Result<BytesMut>
pub fn decrypt_rtp(&mut self, encrypted: &[u8]) -> Result<BytesMut>
DecryptRTP decrypts a RTP packet with an encrypted payload
pub fn encrypt_rtp_with_header( &mut self, plaintext: &[u8], header: &Header, ) -> Result<BytesMut>
Sourcepub fn encrypt_rtp(&mut self, plaintext: &[u8]) -> Result<BytesMut>
pub fn encrypt_rtp(&mut self, plaintext: &[u8]) -> Result<BytesMut>
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
impl Context
Sourcepub fn new(
master_key: &[u8],
master_salt: &[u8],
profile: ProtectionProfile,
srtp_ctx_opt: Option<ContextOption>,
srtcp_ctx_opt: Option<ContextOption>,
) -> Result<Context>
pub fn new( master_key: &[u8], master_salt: &[u8], profile: ProtectionProfile, srtp_ctx_opt: Option<ContextOption>, srtcp_ctx_opt: Option<ContextOption>, ) -> Result<Context>
CreateContext creates a new SRTP Context
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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
Mutably borrows from an owned value. Read more