pub struct Identity { /* private fields */ }Expand description
A self-signed certificate to present on the media path, and its fingerprint.
RFC 5763 §5 wants a self-signed certificate here and says why the absence of a chain does not matter: what authenticates the peer is not the certificate’s issuer but the fingerprint that arrived in the signalling. A certificate authority would authenticate a name, and there is no name on a media path to authenticate.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn generate() -> Result<Self, DtlsError>
pub fn generate() -> Result<Self, DtlsError>
Mint a fresh self-signed certificate.
One per call is fine and one per process is fine; what must not happen is presenting a
certificate whose fingerprint is not the one the SDP announced, so the two are produced
together and Identity::fingerprint is the only way to get one.
Sourcepub fn fingerprint(&self) -> Result<Fingerprint, DtlsError>
pub fn fingerprint(&self) -> Result<Fingerprint, DtlsError>
The fingerprint to put in the SDP (RFC 8122).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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