Struct webrtc::peer_connection::certificate::RTCCertificate
source · pub struct RTCCertificate { /* private fields */ }
Expand description
Certificate represents a X.509 certificate used to authenticate WebRTC communications.
Implementations§
source§impl RTCCertificate
impl RTCCertificate
sourcepub fn from_key_pair(key_pair: KeyPair) -> Result<Self>
pub fn from_key_pair(key_pair: KeyPair) -> Result<Self>
Generates a new certificate with default CertificateParams
using the given keypair.
sourcepub fn from_existing(dtls_certificate: Certificate, expires: SystemTime) -> Self
pub fn from_existing(dtls_certificate: Certificate, expires: SystemTime) -> Self
Builds a RTCCertificate
using the existing DTLS certificate.
Use this method when you have a persistent certificate (i.e. you don’t want to generate a new one for each DTLS connection).
NOTE: ID used for statistics will be different as it’s neither derived from the given
certificate nor persisted along it when using RTCCertificate::serialize_pem
.
sourcepub fn serialize_pem(&self) -> String
pub fn serialize_pem(&self) -> String
Serializes the certificate (including the private key) in PKCS#8 format in PEM.
sourcepub fn get_fingerprints(&self) -> Vec<RTCDtlsFingerprint>
pub fn get_fingerprints(&self) -> Vec<RTCDtlsFingerprint>
get_fingerprints returns a SHA-256 fingerprint of this certificate.
TODO: return a fingerprint computed with the digest algorithm used in the certificate signature.
Trait Implementations§
source§impl Clone for RTCCertificate
impl Clone for RTCCertificate
source§fn clone(&self) -> RTCCertificate
fn clone(&self) -> RTCCertificate
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more