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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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§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