Struct PlatformVerifier
pub struct PlatformVerifier(/* private fields */);crypto and native-certs and std only.Expand description
A TLS server certificate verifier backed by the operating system.
Each instance owns its additional trust anchors. Building one may parse
certificates or create platform objects, so share instances where possible;
PlatformVerifier::shared is the process-wide instance without
additional anchors.
Implementations§
§impl PlatformVerifier
impl PlatformVerifier
pub const IS_AVAILABLE: bool = false
pub const IS_AVAILABLE: bool = false
Whether this platform has an operating system verifier.
pub fn new() -> PlatformVerifier
pub fn new() -> PlatformVerifier
Create a verifier that trusts what the operating system trusts.
pub fn try_with_extra_roots(
roots: impl IntoIterator<Item = CertificateDer<'static>>,
) -> Result<PlatformVerifier, Box<dyn Error + Send + Sync>>
pub fn try_with_extra_roots( roots: impl IntoIterator<Item = CertificateDer<'static>>, ) -> Result<PlatformVerifier, Box<dyn Error + Send + Sync>>
Create a verifier that also trusts roots, in addition to what the
operating system trusts.
The process-wide verifier, which also trusts the
shared_extra_trust_anchors from the environment.
SSL_CERT_FILE and SSL_CERT_DIR are not consulted: they replace a
root store, and the operating system’s verifier has none to replace.
pub fn verify_server_chain(
&self,
end_entity: &CertificateDer<'_>,
intermediates: &[CertificateDer<'_>],
server_name: &Host,
ocsp_response: Option<&[u8]>,
now: SystemTime,
) -> Result<Vec<CertificateDer<'static>>, PlatformVerifyError>
pub fn verify_server_chain( &self, end_entity: &CertificateDer<'_>, intermediates: &[CertificateDer<'_>], server_name: &Host, ocsp_response: Option<&[u8]>, now: SystemTime, ) -> Result<Vec<CertificateDer<'static>>, PlatformVerifyError>
Verify a server certificate chain for server_name at time now.
Android’s initial TrustManager uses the wall clock. The supplied date additionally checks the leaf and the supplementary leaf revocation pass; it does not time-shift intermediate validation. Android therefore does not support general historical certificate validation.
intermediates are the other certificates the server presented, and
ocsp_response a stapled OCSP response, if any. On success the chain
the platform built is returned, leaf first and ending at the trust
anchor.
This may block on network access, e.g. to fetch revocation information or missing intermediates, so do not call it on an async executor thread. A timeout cannot interrupt a running native call. Callers must bound concurrent work independently of handshake deadlines.
Trait Implementations§
§impl Debug for PlatformVerifier
impl Debug for PlatformVerifier
§impl Default for PlatformVerifier
impl Default for PlatformVerifier
§fn default() -> PlatformVerifier
fn default() -> PlatformVerifier
Auto Trait Implementations§
impl Freeze for PlatformVerifier
impl RefUnwindSafe for PlatformVerifier
impl Send for PlatformVerifier
impl Sync for PlatformVerifier
impl Unpin for PlatformVerifier
impl UnsafeUnpin for PlatformVerifier
impl UnwindSafe for PlatformVerifier
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more