Expand description
Client certificate authentication checks.
Policy-free building blocks used by the broker: name matching against the subject CN or a
SAN kind, thumbprint allow-lists and validity period checks. Trust (chain) verification is
in crate::x509::trust. Every failure is a distinct Failure so callers can map it to their
own error codes.
Decisions:
- Name comparison is case-insensitive (Unicode lowercase of both sides).
- Subject matching uses the first CN attribute only.
- SAN matching succeeds if any entry of the kind matches.
- IP matching compares parsed addresses (
::0:1equals::1); SAN IP entries that are not 4 or 16 octets are ignored when matching, but rejected byfield. - Thumbprints are hex, compared case-insensitively; exactly 40 characters selects SHA-1,
anything else SHA-256 (see
crate::x509::digest::Algorithm::for_hex_thumbprint).
Enums§
Functions§
- field
- Returns the client name stored in the certificate
field, lowercased. - name_
matches - Checks that
namematches the certificatefield. - thumbprint_
matches - Returns
trueif any of the hexthumbprintsmatches the certificate. - validity
- Checks that
nowis within the certificate validity period (bounds inclusive) and returnsnotAfter. - verify_
thumbprint - Checks validity period and thumbprint allow-list, returns
notAfter.