pub struct CryptoProvider {
pub srtp_provider: &'static dyn SrtpProvider,
pub sha1_hmac_provider: &'static dyn Sha1HmacProvider,
pub sha1_provider: &'static dyn Sha1Provider,
pub sha256_provider: &'static dyn Sha256Provider,
pub dtls_provider: &'static dyn DtlsProvider,
}Expand description
Cryptographic provider for SRTP, hashing, SHA1 HMAC, and DTLS operations.
This struct holds references to all cryptographic components needed for WebRTC operations. Users can provide custom implementations of each component to replace the default OpenSSL-based provider.
§Design
The provider uses static trait object references (&'static dyn Trait) which
provides zero runtime overhead for trait dispatch. This design is inspired by
dimpl’s CryptoProvider and ensures efficient crypto operations.
Fields§
§srtp_provider: &'static dyn SrtpProviderSRTP provider for creating cipher instances and key derivation.
sha1_hmac_provider: &'static dyn Sha1HmacProviderSHA1 HMAC provider for STUN message integrity.
sha1_provider: &'static dyn Sha1ProviderSHA-1 hash provider for legacy certificate fingerprints.
sha256_provider: &'static dyn Sha256ProviderSHA-256 hash provider.
dtls_provider: &'static dyn DtlsProviderDTLS provider for creating DTLS instances.
Implementations§
Source§impl CryptoProvider
impl CryptoProvider
Sourcepub fn install_process_default(self)
pub fn install_process_default(self)
Install this provider as the process-wide default.
Sourcepub fn install_default(provider: CryptoProvider)
pub fn install_default(provider: CryptoProvider)
Sourcepub fn get_default() -> Option<&'static CryptoProvider>
pub fn get_default() -> Option<&'static CryptoProvider>
Get the default crypto provider, if one has been installed.
Trait Implementations§
Source§impl Clone for CryptoProvider
impl Clone for CryptoProvider
Source§fn clone(&self) -> CryptoProvider
fn clone(&self) -> CryptoProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CryptoProvider
impl Debug for CryptoProvider
Source§impl Display for CryptoProvider
impl Display for CryptoProvider
impl RefUnwindSafe for CryptoProvider
impl UnwindSafe for CryptoProvider
CryptoProvider contains only static references to thread-safe traits, so it’s safe to use across panic boundaries.