StormByte-Crypto 3.1.0
C++26 cryptography module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Crypto::X509::TLSPeerVerifier Class Reference

Stateless composition for a deliberately constrained TLS 1.3 signing role. More...

#include <StormByte/crypto/x509/tls_peer.hxx>

Public Member Functions

 TLSPeerVerifier ()=delete
 Non-instantiable stateless verifier.
 TLSPeerVerifier (const TLSPeerVerifier &other)=delete
 Non-copyable stateless verifier.
 TLSPeerVerifier (TLSPeerVerifier &&other)=delete
 Non-movable stateless verifier.
 ~TLSPeerVerifier ()=delete
 No instances exist to destroy.
TLSPeerVerifier & operator= (const TLSPeerVerifier &other)=delete
 Copy assignment is unavailable.
TLSPeerVerifier & operator= (TLSPeerVerifier &&other)=delete
 Move assignment is unavailable.

Static Public Member Functions

static ExpectedTLSPeer Verify (const Certificate &leaf, std::span< const Certificate > intermediates, const Certificate &anchor, TimePoint at, TLSRole role, const SubjectAltName *identity=nullptr)
 Verifies an ordered chain, signing purpose and optional SAN identity.

Detailed Description

Stateless composition for a deliberately constrained TLS 1.3 signing role.

Not a TLS handshake or full RFC 5280 validator; no proof of key possession, revocation, path building, trust discovery, network access or policy evaluation. Success alone is NOT public HTTPS-ready authentication.

Constructor & Destructor Documentation

◆ TLSPeerVerifier() [1/3]

StormByte::Crypto::X509::TLSPeerVerifier::TLSPeerVerifier ( )
delete

Non-instantiable stateless verifier.

◆ TLSPeerVerifier() [2/3]

StormByte::Crypto::X509::TLSPeerVerifier::TLSPeerVerifier ( const TLSPeerVerifier & other)
delete

Non-copyable stateless verifier.

Parameters
otherUnavailable source.

◆ TLSPeerVerifier() [3/3]

StormByte::Crypto::X509::TLSPeerVerifier::TLSPeerVerifier ( TLSPeerVerifier && other)
delete

Non-movable stateless verifier.

Parameters
otherUnavailable source.

◆ ~TLSPeerVerifier()

StormByte::Crypto::X509::TLSPeerVerifier::~TLSPeerVerifier ( )
delete

No instances exist to destroy.

Member Function Documentation

◆ operator=() [1/2]

TLSPeerVerifier & StormByte::Crypto::X509::TLSPeerVerifier::operator= ( const TLSPeerVerifier & other)
delete

Copy assignment is unavailable.

Parameters
otherUnavailable source.
Returns
No instance can be assigned.

◆ operator=() [2/2]

TLSPeerVerifier & StormByte::Crypto::X509::TLSPeerVerifier::operator= ( TLSPeerVerifier && other)
delete

Move assignment is unavailable.

Parameters
otherUnavailable source.
Returns
No instance can be assigned.

◆ Verify()

ExpectedTLSPeer StormByte::Crypto::X509::TLSPeerVerifier::Verify ( const Certificate & leaf,
std::span< const Certificate > intermediates,
const Certificate & anchor,
TimePoint at,
TLSRole role,
const SubjectAltName * identity = nullptr )
static

Verifies an ordered chain, signing purpose and optional SAN identity.

Parameters
leafUntrusted non-CA peer certificate.
intermediatesIssuers in exact leaf-to-anchor order; excludes leaf and anchor.
anchorCaller-selected trusted CA certificate, not inferred from the chain.
atExplicit caller time, tested inclusively on every certificate.
roleServer or Client signing role, not a TLS key-exchange policy.
identityCaller-owned DNS text or network-order IP bytes in SubjectAltName. Required for Server. Null for Client checks trust/purpose only and makes no client-identity or application-authorization assertion.
Returns
Success for this subset, or the first typed failure with certificate index.
Exceptions
StormByte::Safe::AllocationErrorResult or SAN storage cannot be allocated.

Composes the existing signature/name, validity, CA/pathLen, KU and SAN helpers without changing Certificate::VerifyChain. Each issuer requires keyCertSign if KU exists; only the leaf requires digitalSignature. Each present EKU, including on the anchor, must explicitly grant the role (anyEKU alone fails).

The anchor is external trust input, so its self-signature and issuer name are NOT verified. As a deliberate local policy, its validity, v3 CA status, pathLen, KU, EKU, public-key suitability and extensions ARE enforced just like an issuer; this is stricter than RFC 5280's abstract trust-anchor input. Names chain by exact DER, and pathLen counts every supplied intermediate, including self-issued ones (conservative; no self-issued rollover processing).

Keys: RSA 2048..8192 bits or named-curve ECDSA P-256/P-384/P-521. Non-anchor signatures: RSA PKCS#1 v1.5 or ECDSA with SHA-256/384/512. Critical BC, KU, EKU and DNS/IP-only SAN are processed. All other critical extensions, including SKI/AKI and certificatePolicies, fail unsupported. Name constraints, policy mappings, policy constraints and inhibitAnyPolicy fail unsupported even when noncritical. Noncritical certificatePolicies asserts policies but does not itself restrict a path: it is ignored, with no requested-policy acceptance claim. Other noncritical hints (SKI/AKI, AIA, CRL distribution points, issuerAltName, etc.) are ignored. TLS Feature (including OCSP Must-Staple) and proxyCertInfo also fail unsupported even when noncritical; their additional obligations cannot be satisfied by this certificate-only entrypoint.

Every present SAN and KU/EKU is validated, even on issuers or identityless clients. KU agreement-only bits require keyAgreement; keyCertSign requires cA. No CN fallback. No CRL/OCSP checks; a revoked certificate can pass. See doc/tls-peer-verification.md for the supported-subset contract.


The documentation for this class was generated from the following file: