Struct libp2p_webrtc_utils::Fingerprint
source · pub struct Fingerprint(/* private fields */);
Expand description
A certificate fingerprint that is assumed to be created using the SHA256 hash algorithm.
Implementations§
source§impl Fingerprint
impl Fingerprint
pub const FF: Fingerprint = _
pub const fn raw(digest: [u8; 32]) -> Self
sourcepub fn from_certificate(bytes: &[u8]) -> Self
pub fn from_certificate(bytes: &[u8]) -> Self
Creates a new Fingerprint from a raw certificate by hashing the given bytes with SHA256.
sourcepub fn try_from_multihash(hash: Multihash<64>) -> Option<Self>
pub fn try_from_multihash(hash: Multihash<64>) -> Option<Self>
Converts Multihash
to Fingerprint
.
sourcepub fn to_multihash(self) -> Multihash<64>
pub fn to_multihash(self) -> Multihash<64>
Converts this fingerprint to Multihash
.
sourcepub fn to_sdp_format(self) -> String
pub fn to_sdp_format(self) -> String
Formats this fingerprint as uppercase hex, separated by colons (:
).
This is the format described in https://www.rfc-editor.org/rfc/rfc4572#section-5.
sourcepub fn algorithm(&self) -> String
pub fn algorithm(&self) -> String
Returns the algorithm used (e.g. “sha-256”). See https://datatracker.ietf.org/doc/html/rfc8122#section-5
Trait Implementations§
source§impl Clone for Fingerprint
impl Clone for Fingerprint
source§fn clone(&self) -> Fingerprint
fn clone(&self) -> Fingerprint
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 Fingerprint
impl Debug for Fingerprint
source§impl PartialEq for Fingerprint
impl PartialEq for Fingerprint
source§fn eq(&self, other: &Fingerprint) -> bool
fn eq(&self, other: &Fingerprint) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for Fingerprint
impl Eq for Fingerprint
impl StructuralPartialEq for Fingerprint
Auto Trait Implementations§
impl Freeze for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnwindSafe for Fingerprint
Blanket Implementations§
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> 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