Struct msf_srtp::SrtpContext
source · [−]pub struct SrtpContext { /* private fields */ }
Expand description
SRTP context.
Implementations
sourceimpl SrtpContext
impl SrtpContext
sourcepub fn builder() -> SrtpContextBuilder
pub fn builder() -> SrtpContextBuilder
Get an SRTP context builder.
sourcepub fn new<T>(key: &PKeyRef<T>, cert: &X509Ref) -> Result<Self, Error> where
T: HasPrivate,
pub fn new<T>(key: &PKeyRef<T>, cert: &X509Ref) -> Result<Self, Error> where
T: HasPrivate,
Create a new SRTP context builder that will use a given private key, certificate and default parameters.
sourcepub fn self_signed<T>(key: &PKeyRef<T>) -> Result<Self, Error> where
T: HasPrivate,
pub fn self_signed<T>(key: &PKeyRef<T>) -> Result<Self, Error> where
T: HasPrivate,
Create a new SRTP context with self signed certificate from a given key and use default parameters.
sourcepub fn from_ssl_context(context: SslContext) -> Result<Self, Error>
pub fn from_ssl_context(context: SslContext) -> Result<Self, Error>
Create a new SRTP context from a given SSL context and use default parameters.
Panics
The method panics if the given context does not contain any private key or a certificate.
sourcepub fn certificate_fingerprint(
&self,
hash_function: HashFunction
) -> Result<CertificateFingerprint, Error>
pub fn certificate_fingerprint(
&self,
hash_function: HashFunction
) -> Result<CertificateFingerprint, Error>
Get a certificate fingerprint.
sourcepub fn connect_srtp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
pub fn connect_srtp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
Connect to a given SRTP “server” and check that the peer certificate matches a given fingerprint.
sourcepub fn connect_srtcp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtcpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
pub fn connect_srtcp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtcpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
Connect to a given SRTCP “server” and check that the peer certificate matches a given fingerprint.
sourcepub fn connect_muxed<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<MuxedSrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
pub fn connect_muxed<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<MuxedSrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
Connect to a given muxed SRTP-SRTCP “server” and check that the peer certificate matches a given fingerprint.
sourcepub fn accept_srtp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
pub fn accept_srtp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
Accept connection from a given SRTP “client” and check that the peer certificate matches a given fingerprint.
sourcepub fn accept_srtcp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtcpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
pub fn accept_srtcp<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<SrtcpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
Accept connection from a given SRTCP “client” and check that the peer certificate matches a given fingerprint.
sourcepub fn accept_muxed<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<MuxedSrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
pub fn accept_muxed<S>(
&self,
stream: S,
peer_cert_fingerprint: CertificateFingerprint
) -> impl Future<Output = Result<MuxedSrtpStream<S>, Error>> where
S: Stream<Item = Result<Bytes>> + Sink<Bytes, Error = Error> + Unpin,
Accept connection from a given muxed SRTP-SRTCP “client” and check that the peer certificate matches a given fingerprint.
Auto Trait Implementations
impl RefUnwindSafe for SrtpContext
impl Send for SrtpContext
impl Sync for SrtpContext
impl Unpin for SrtpContext
impl UnwindSafe for SrtpContext
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