StormByte-Crypto 3.1.0
C++26 cryptography module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Crypto::TLS Namespace Reference

TLS 1.3 policy and buffer-driven session engine. More...

Classes

struct  Configuration
 Mutable input with independent ordered preference lists. More...
struct  CipherSuiteDefinition
 Fixed primitive mapping, not an independently selectable pair. More...
class  Policy
 Immutable validated TLS 1.3 policy snapshot. More...
struct  ClientConfiguration
 Borrowed construction inputs for an authenticated TLS client. More...
struct  ServerConfiguration
 Borrowed construction inputs for a TLS server. More...
class  Session
 OpenSSL-backed TLS 1.3 stream engine driven only by caller buffers. More...

Typedefs

using ExpectedPolicy = StormByte::Expected<Policy, Error>
 Validated policy or Base-owned typed configuration error.
using ExpectedCipherSuiteDefinition = StormByte::Expected<CipherSuiteDefinition, Error>
 Fixed suite definition or Base-owned unsupported-suite error.

Enumerations

enum class  Version : std::uint16_t { TLS13 = 0x0304 }
 Protocol versions designated for policy configuration. More...
enum class  CipherSuite : std::uint16_t { TLS_AES_128_GCM_SHA256 = 0x1301 , TLS_AES_256_GCM_SHA384 = 0x1302 }
 TLS 1.3 suites supported by the buffer-driven session engine. More...
enum class  Group : std::uint16_t { X25519 = 0x001d , Secp256r1 = 0x0017 }
 Named groups supported by the initial TLS 1.3 profile. More...
enum class  SignatureScheme : std::uint16_t { ECDSA_SECP256R1_SHA256 = 0x0403 , RSA_PSS_RSAE_SHA256 = 0x0804 }
 TLS 1.3 signature schemes supported by the session engine. More...
enum class  Error {
  UnsupportedVersion , EmptyCipherSuites , UnsupportedCipherSuite , DuplicateCipherSuite ,
  EmptyGroups , UnsupportedGroup , DuplicateGroup , EmptySignatureSchemes ,
  UnsupportedSignatureScheme , DuplicateSignatureScheme
}
 Configuration failures; no connection or backend is exercised. More...
enum class  Role { Client , Server }
 TLS endpoint role for a stream session. More...
enum class  State {
  Handshaking , Open , Closing , Closed ,
  Failed
}
 Observable lifecycle of a buffer-driven TLS session. More...
enum class  SessionError {
  InvalidConfiguration , UnsupportedPolicy , BackendFailure , PeerRejected ,
  InvalidState , BufferLimit
}
 Typed TLS session failures. More...
enum class  TrustSource { Bundled , Custom }
 Source of trust anchors for a client or mutual-TLS server. More...

Functions

ExpectedPolicy Validate (const Configuration &configuration)
 Validate only membership, nonempty lists and uniqueness for the profile.
Configuration InitialProfile ()
 All designated initial-profile entries in default preference order.
ExpectedCipherSuiteDefinition DescribeCipherSuite (CipherSuite suite)
 Describe a registered suite's fixed AEAD and HKDF/transcript hash.
const char * DescribeSessionError (SessionError error) noexcept
 Describe a typed setup or operation failure without accessing backend state.

Detailed Description

TLS 1.3 policy and buffer-driven session engine.

TLS policy and buffer-driven session implementation.

Typedef Documentation

◆ ExpectedCipherSuiteDefinition

Fixed suite definition or Base-owned unsupported-suite error.

◆ ExpectedPolicy

Validated policy or Base-owned typed configuration error.

Enumeration Type Documentation

◆ CipherSuite

enum class StormByte::Crypto::TLS::CipherSuite : std::uint16_t
strong

TLS 1.3 suites supported by the buffer-driven session engine.

Enumerator
TLS_AES_128_GCM_SHA256 

AES-128-GCM with SHA-256 transcript and HKDF.

TLS_AES_256_GCM_SHA384 

AES-256-GCM with SHA-384 transcript and HKDF.

◆ Error

enum class StormByte::Crypto::TLS::Error
strong

Configuration failures; no connection or backend is exercised.

Enumerator
UnsupportedVersion 

Version is not exactly TLS 1.3.

EmptyCipherSuites 

No allowed cipher suite was specified.

UnsupportedCipherSuite 

A suite is outside the designated initial profile.

DuplicateCipherSuite 

A suite appears more than once.

EmptyGroups 

No allowed group was specified.

UnsupportedGroup 

A group is outside the designated initial profile.

DuplicateGroup 

A group appears more than once.

EmptySignatureSchemes 

No allowed signature scheme was specified.

UnsupportedSignatureScheme 

A scheme is outside the supported TLS 1.3 profile.

DuplicateSignatureScheme 

A scheme appears more than once.

◆ Group

enum class StormByte::Crypto::TLS::Group : std::uint16_t
strong

Named groups supported by the initial TLS 1.3 profile.

Enumerator
X25519 

Curve25519 key agreement.

Secp256r1 

NIST P-256 key agreement.

◆ Role

enum class StormByte::Crypto::TLS::Role
strong

TLS endpoint role for a stream session.

Enumerator
Client 

Initiates a TLS handshake and authenticates a server.

Server 

Accepts a TLS handshake and presents a configured certificate.

◆ SessionError

Typed TLS session failures.

Enumerator
InvalidConfiguration 

Invalid role, identity, certificate, key or trust configuration.

UnsupportedPolicy 

The selected TLS policy cannot be represented by this engine.

BackendFailure 

OpenSSL failed an operation or resource allocation.

PeerRejected 

Peer certificate, trust path, identity or revocation was rejected.

InvalidState 

The requested operation is invalid for this session state.

BufferLimit 

A configured internal bound would be exceeded.

◆ SignatureScheme

enum class StormByte::Crypto::TLS::SignatureScheme : std::uint16_t
strong

TLS 1.3 signature schemes supported by the session engine.

Enumerator
ECDSA_SECP256R1_SHA256 

P-256 ECDSA/SHA-256.

RSA_PSS_RSAE_SHA256 

RSA-PSS/SHA-256 with an rsaEncryption certificate key.

◆ State

enum class StormByte::Crypto::TLS::State
strong

Observable lifecycle of a buffer-driven TLS session.

Enumerator
Handshaking 

The peer handshake is not yet complete.

Open 

The handshake completed and application data may flow.

Closing 

A local or peer close-notify is being exchanged.

Closed 

TLS shutdown completed.

Failed 

A fatal protocol, validation or backend error occurred.

◆ TrustSource

Source of trust anchors for a client or mutual-TLS server.

Enumerator
Bundled 

The versioned StormByte public server-root bundle.

Custom 

Only the explicitly supplied certificate authorities.

◆ Version

enum class StormByte::Crypto::TLS::Version : std::uint16_t
strong

Protocol versions designated for policy configuration.

Enumerator
TLS13 

TLS 1.3 supported_versions identifier, not the record legacy version.

Function Documentation

◆ DescribeCipherSuite()

ExpectedCipherSuiteDefinition StormByte::Crypto::TLS::DescribeCipherSuite ( CipherSuite suite)

Describe a registered suite's fixed AEAD and HKDF/transcript hash.

Parameters
suiteRegistered cipher-suite identifier to describe.
Returns
Fixed primitive mapping or UnsupportedCipherSuite.
Exceptions
StormByte::Safe::AllocationErrorError storage cannot be allocated.

◆ DescribeSessionError()

const char * StormByte::Crypto::TLS::DescribeSessionError ( SessionError error)
noexcept

Describe a typed setup or operation failure without accessing backend state.

Parameters
errorFailure code.
Returns
Static English text; never null, including for unknown codes.

◆ InitialProfile()

Configuration StormByte::Crypto::TLS::InitialProfile ( )

All designated initial-profile entries in default preference order.

Returns
Independently owned lists of every designated profile entry.
Exceptions
StormByte::Safe::AllocationErrorPreference storage cannot be allocated.
Note
This is the default TLS 1.3 policy profile. Each call returns independently owned mutable Safe containers.

◆ Validate()

ExpectedPolicy StormByte::Crypto::TLS::Validate ( const Configuration & configuration)

Validate only membership, nonempty lists and uniqueness for the profile.

Permit snapshot construction only after designated-profile validation.

Parameters
configurationMutable caller input copied on success.
Returns
Immutable owned snapshot or first typed error.
Exceptions
StormByte::Safe::AllocationErrorProfile, snapshot or error storage cannot be allocated.
Note
Validation order is version, suites, groups, signatures; within a list, left to right. A valid configuration is used by the TLS session engine. Allocation exceptions propagate; borrowed input is not retained.