pub struct TrustStore { /* private fields */ }Expand description
Container for root certificates able to provide a root-of-trust for connection authentication
Platform native root certificates are enabled by default. To start with a clean trust store use TrustStore::empty
Implementations§
Source§impl TrustStore
impl TrustStore
Sourcepub fn with_native_roots(self, enable_native_roots: bool) -> Self
pub fn with_native_roots(self, enable_native_roots: bool) -> Self
Enable or disable using the platform’s native trusted root certificate store
Default: true
Sourcepub fn with_pem_certificate(self, pem_bytes: impl Into<Vec<u8>>) -> Self
pub fn with_pem_certificate(self, pem_bytes: impl Into<Vec<u8>>) -> Self
Add the PEM encoded certificate to the trust store
This may be called more than once to add multiple certificates. NOTE: PEM certificate contents are not validated until passed to the configured TLS provider.
Sourcepub fn add_pem_certificate(
&mut self,
pem_bytes: impl Into<Vec<u8>>,
) -> &mut Self
pub fn add_pem_certificate( &mut self, pem_bytes: impl Into<Vec<u8>>, ) -> &mut Self
Add the PEM encoded certificate to the trust store
This may be called more than once to add multiple certificates. NOTE: PEM certificate contents are not validated until passed to the configured TLS provider.
Trait Implementations§
Source§impl Clone for TrustStore
impl Clone for TrustStore
Source§fn clone(&self) -> TrustStore
fn clone(&self) -> TrustStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TrustStore
impl Debug for TrustStore
Auto Trait Implementations§
impl Freeze for TrustStore
impl RefUnwindSafe for TrustStore
impl Send for TrustStore
impl Sync for TrustStore
impl Unpin for TrustStore
impl UnsafeUnpin for TrustStore
impl UnwindSafe for TrustStore
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> 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 moreCreates a shared type from an unshared type.