Struct libp2p_webrtc::tokio::certificate::Certificate
source · pub struct Certificate { /* private fields */ }
Available on crate feature
tokio
only.Implementations§
source§impl Certificate
impl Certificate
sourcepub fn generate<R>(_rng: &mut R) -> Result<Self, Error>
pub fn generate<R>(_rng: &mut R) -> Result<Self, Error>
Generate new certificate.
_rng
argument is ignored for now. See https://github.com/melekes/rust-libp2p/pull/12.
sourcepub fn fingerprint(&self) -> Fingerprint
pub fn fingerprint(&self) -> Fingerprint
Returns SHA-256 fingerprint of this certificate.
§Panics
This function will panic if there’s no fingerprint with the SHA-256 algorithm (see
RTCCertificate::get_fingerprints
).
sourcepub fn from_pem(pem_str: &str) -> Result<Self, Error>
Available on crate feature pem
only.
pub fn from_pem(pem_str: &str) -> Result<Self, Error>
pem
only.Parses a certificate from the ASCII PEM format.
sourcepub fn serialize_pem(&self) -> String
Available on crate feature pem
only.
pub fn serialize_pem(&self) -> String
pem
only.Serializes the certificate (including the private key) in PKCS#8 format in PEM.
Trait Implementations§
source§impl Clone for Certificate
impl Clone for Certificate
source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Certificate
impl Debug for Certificate
source§impl PartialEq for Certificate
impl PartialEq for Certificate
impl StructuralPartialEq for Certificate
Auto Trait Implementations§
impl Freeze for Certificate
impl RefUnwindSafe for Certificate
impl Send for Certificate
impl Sync for Certificate
impl Unpin for Certificate
impl UnwindSafe for Certificate
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more