#[non_exhaustive]pub enum CertificateType {
X509,
RawPublicKey,
}Expand description
What a peer authenticates with: an X.509 certificate, or a raw public key (RFC 7250).
Text form: x509, raw_public_key. The choice is the whole connection’s: both directions
use it (the server’s own, and the client’s when it presents an identity), negotiated with
the server_certificate_type and client_certificate_type extensions. A peer that holds
one type and meets a peer that holds the other is refused, by the side that finds out as
Refusal::CertificateType; rustls offers no list of both
types.
With a raw public key the peer sends its SubjectPublicKeyInfo and nothing else: it has no
dates, names, issuer or chain, so check_validity and
allow_chain_when_pinned have nothing to decide, trust
that needs a certificate (Trust::Roots, the CA trusts) is a
PeerError::Policy, and a peer is pinned by the SHA-256 id of its SubjectPublicKeyInfo.
rustls verifies a raw key in TLS 1.3 only, so only TLS 1.3 is offered whatever
tls_versions lists, and a policy without it is a
PeerError::Policy. The cipher profiles apply as to a certificate: the key must sign with a
scheme the profile verifies (cnsa-1.0 takes ECDSA P-384, cnsa-2.0 ML-DSA-87).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
X509
x509: a certificate, as before. The default.
RawPublicKey
raw_public_key: the key alone, RFC 7250.