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

DLL-safe typed failure, with a leaf-to-anchor certificate index. More...

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

Public Member Functions

 TLSPeerFailure () noexcept
 Constructs an invalid-certificate failure at the leaf.
 TLSPeerFailure (TLSPeerError code, std::size_t index=0) noexcept
 Constructs a chain or request failure.
 TLSPeerFailure (PurposeError detail, std::size_t index) noexcept
 Preserves a purpose failure.
 TLSPeerFailure (IdentityError detail, std::size_t index=0) noexcept
 Preserves an identity or SAN-validation failure.
 TLSPeerFailure (const TLSPeerFailure &other) noexcept
 Copies a failure.
 TLSPeerFailure (TLSPeerFailure &&other) noexcept
 Moves a failure; the source remains usable.
 ~TLSPeerFailure () noexcept
 Destroys a failure.
TLSPeerFailure & operator= (const TLSPeerFailure &other) noexcept
 Copies a failure.
TLSPeerFailure & operator= (TLSPeerFailure &&other) noexcept
 Moves a failure; the source remains usable.
TLSPeerError Code () const noexcept
 Returns the failure category.
std::size_t CertificateIndex () const noexcept
 Returns the certificate position.
PurposeError PurposeDetail () const noexcept
 Returns the preserved purpose error.
IdentityError IdentityDetail () const noexcept
 Returns the preserved identity error.

Detailed Description

DLL-safe typed failure, with a leaf-to-anchor certificate index.

Note
All state is trivial; all value operations are out of line.

Constructor & Destructor Documentation

◆ TLSPeerFailure() [1/6]

StormByte::Crypto::X509::TLSPeerFailure::TLSPeerFailure ( )
noexcept

Constructs an invalid-certificate failure at the leaf.

◆ TLSPeerFailure() [2/6]

StormByte::Crypto::X509::TLSPeerFailure::TLSPeerFailure ( TLSPeerError code,
std::size_t index = 0 )
explicitnoexcept

Constructs a chain or request failure.

Parameters
codeFailure category.
indexLeaf is 0, intermediates are 1..N, anchor is N+1.

◆ TLSPeerFailure() [3/6]

StormByte::Crypto::X509::TLSPeerFailure::TLSPeerFailure ( PurposeError detail,
std::size_t index )
explicitnoexcept

Preserves a purpose failure.

Parameters
detailExact purpose error.
indexCertificate that failed.

◆ TLSPeerFailure() [4/6]

StormByte::Crypto::X509::TLSPeerFailure::TLSPeerFailure ( IdentityError detail,
std::size_t index = 0 )
explicitnoexcept

Preserves an identity or SAN-validation failure.

Parameters
detailExact identity error.
indexCertificate that failed; identity matching uses the leaf.

◆ TLSPeerFailure() [5/6]

StormByte::Crypto::X509::TLSPeerFailure::TLSPeerFailure ( const TLSPeerFailure & other)
noexcept

Copies a failure.

Parameters
otherSource.

◆ TLSPeerFailure() [6/6]

StormByte::Crypto::X509::TLSPeerFailure::TLSPeerFailure ( TLSPeerFailure && other)
noexcept

Moves a failure; the source remains usable.

Parameters
otherSource.

◆ ~TLSPeerFailure()

StormByte::Crypto::X509::TLSPeerFailure::~TLSPeerFailure ( )
noexcept

Destroys a failure.

Member Function Documentation

◆ CertificateIndex()

std::size_t StormByte::Crypto::X509::TLSPeerFailure::CertificateIndex ( ) const
noexcept

Returns the certificate position.

Returns
Leaf-to-anchor index; request and identity-matching errors use 0.

◆ Code()

TLSPeerError StormByte::Crypto::X509::TLSPeerFailure::Code ( ) const
noexcept

Returns the failure category.

Returns
Failure category.

◆ IdentityDetail()

IdentityError StormByte::Crypto::X509::TLSPeerFailure::IdentityDetail ( ) const
noexcept

Returns the preserved identity error.

Returns
Identity error; meaningful only when Code() is Identity.

◆ operator=() [1/2]

TLSPeerFailure & StormByte::Crypto::X509::TLSPeerFailure::operator= ( const TLSPeerFailure & other)
noexcept

Copies a failure.

Parameters
otherSource.
Returns
This failure.

◆ operator=() [2/2]

TLSPeerFailure & StormByte::Crypto::X509::TLSPeerFailure::operator= ( TLSPeerFailure && other)
noexcept

Moves a failure; the source remains usable.

Parameters
otherSource.
Returns
This failure.

◆ PurposeDetail()

PurposeError StormByte::Crypto::X509::TLSPeerFailure::PurposeDetail ( ) const
noexcept

Returns the preserved purpose error.

Returns
Purpose error; meaningful only when Code() is Purpose.

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