pub struct CaCerts { /* private fields */ }Expand description
Registered CA certificates (trust anchors).
Implementations§
Source§impl CaCerts
impl CaCerts
Sourcepub fn from_certs<I, C>(certs: I) -> CaCerts
pub fn from_certs<I, C>(certs: I) -> CaCerts
Builds a trust store from certificates.
Certificates the backend refuses are logged (with the SHA-1 thumbprint) and skipped.
Sourcepub fn from_certs_with<I, F>(certs: I) -> CaCerts
pub fn from_certs_with<I, F>(certs: I) -> CaCerts
Builds a trust store from certificates, each paired with an error handler.
The handler is called with the backend error if the certificate is refused; the certificate is then skipped. Duplicates are added once and their handler is not called. Lets callers report refusals with their own context (e.g. a configured name).
Sourcepub fn certs(&self) -> &[Certificate]
pub fn certs(&self) -> &[Certificate]
Registered certificates.
Sourcepub fn is_trusted(
&self,
peer: &PeerCerts,
now: SystemTime,
) -> Result<SystemTime, TrustError>
pub fn is_trusted( &self, peer: &PeerCerts, now: SystemTime, ) -> Result<SystemTime, TrustError>
Verifies the peer certificates against the registered CA certificates at time now.
Returns the earliest not_after of the verified path, see the module docs.
§Errors
TrustError::Unauthenticatedif no CA certificates are registered or the peer certificate is rejected;TrustError::Internalif the verification could not be performed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CaCerts
impl RefUnwindSafe for CaCerts
impl Send for CaCerts
impl Sync for CaCerts
impl Unpin for CaCerts
impl UnsafeUnpin for CaCerts
impl UnwindSafe for CaCerts
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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