Struct msf_srtp::SrtpContextBuilder
source · [−]pub struct SrtpContextBuilder { /* private fields */ }
Expand description
SRTP context builder.
Implementations
sourceimpl SrtpContextBuilder
impl SrtpContextBuilder
sourcepub fn profile(self, profile: SrtpProfileId) -> Self
pub fn profile(self, profile: SrtpProfileId) -> Self
Enable a given SRTP profile.
Multiple SRTP profiles can be enabled by calling this method multiple times. The order in which you enable SRTP profiles matters. The first enabled profile will have the highest priority when negotiating session parameters with a remote peer.
If you don’t enable any profiles, the default profiles will be enabled:
SRTP_AES128_CM_SHA1_80
SRTP_AES128_CM_SHA1_32
sourcepub fn with_ssl_context(self, context: SslContext) -> Result<SrtpContext, Error>
pub fn with_ssl_context(self, context: SslContext) -> Result<SrtpContext, Error>
Create a new SRTP context from a given SSL context.
Panics
This methods panics if the given SSL context does not contain any private key or certificate.
sourcepub fn build<T>(
self,
key: &PKeyRef<T>,
cert: &X509Ref
) -> Result<SrtpContext, Error> where
T: HasPrivate,
pub fn build<T>(
self,
key: &PKeyRef<T>,
cert: &X509Ref
) -> Result<SrtpContext, Error> where
T: HasPrivate,
Create a new SRTP context from a given private key and a corresponding certificate.
sourcepub fn self_signed<T>(self, key: &PKeyRef<T>) -> Result<SrtpContext, Error> where
T: HasPrivate,
pub fn self_signed<T>(self, key: &PKeyRef<T>) -> Result<SrtpContext, Error> where
T: HasPrivate,
Create a new SRTP context with a self-signed certificate from a given private key.
Auto Trait Implementations
impl RefUnwindSafe for SrtpContextBuilder
impl Send for SrtpContextBuilder
impl Sync for SrtpContextBuilder
impl Unpin for SrtpContextBuilder
impl UnwindSafe for SrtpContextBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more