pub struct PeerServerVerifier { /* private fields */ }Expand description
Verifies the certificate a server presents to a dialing client.
A pinned certificate is taken because it is pinned, and because the server proves in the
handshake that it holds the key; its name is not checked. Validity dates and the absence
of a chain are checked as the Policy says, after the pin matched. With
Roots, a certificate no pin matches is taken when its chain, dates and
name verify against the roots for the server name dialled.
Implementations§
Source§impl PeerServerVerifier
impl PeerServerVerifier
Sourcepub fn new(trust: &Trust, policy: &Policy) -> Result<Arc<Self>, PeerError>
pub fn new(trust: &Trust, policy: &Policy) -> Result<Arc<Self>, PeerError>
The verifier a client uses for the server certificate, for trust under policy.
§Errors
PeerError::Unsupported for CA policies, which only servers apply;
PeerError::Policy when a pin uses a digest the policy refuses;
PeerError::Io when a roots bundle file cannot be read, PeerError::Certificate
when it holds no certificate or one that cannot be a root, or the platform verifier
cannot start.
Trait Implementations§
Source§impl Debug for PeerServerVerifier
impl Debug for PeerServerVerifier
Source§impl ServerCertVerifier for PeerServerVerifier
impl ServerCertVerifier for PeerServerVerifier
Source§fn verify_server_cert(
&self,
certificate: &CertificateDer<'_>,
intermediates: &[CertificateDer<'_>],
name: &ServerName<'_>,
ocsp_response: &[u8],
now: UnixTime,
) -> Result<ServerCertVerified, Error>
fn verify_server_cert( &self, certificate: &CertificateDer<'_>, intermediates: &[CertificateDer<'_>], name: &ServerName<'_>, ocsp_response: &[u8], now: UnixTime, ) -> Result<ServerCertVerified, Error>
end_entity is valid for the
hostname dns_name and chains to at least one trust anchor. Read moreSource§fn verify_tls12_signature(
&self,
message: &[u8],
certificate: &CertificateDer<'_>,
signed: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, Error>
fn verify_tls12_signature( &self, message: &[u8], certificate: &CertificateDer<'_>, signed: &DigitallySignedStruct, ) -> Result<HandshakeSignatureValid, Error>
Source§fn verify_tls13_signature(
&self,
message: &[u8],
certificate: &CertificateDer<'_>,
signed: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, Error>
fn verify_tls13_signature( &self, message: &[u8], certificate: &CertificateDer<'_>, signed: &DigitallySignedStruct, ) -> Result<HandshakeSignatureValid, Error>
Source§fn supported_verify_schemes(&self) -> Vec<SignatureScheme>
fn supported_verify_schemes(&self) -> Vec<SignatureScheme>
verify_tls12_signature and verify_tls13_signature calls. Read moreSource§fn requires_raw_public_keys(&self) -> bool
fn requires_raw_public_keys(&self) -> bool
§fn root_hint_subjects(&self) -> Option<&[DistinguishedName]>
fn root_hint_subjects(&self) -> Option<&[DistinguishedName]>
DistinguishedName]s of certificate authorities that this verifier trusts. Read more