std.x.tls.client [x] std.x.tls.client.suite_chacha20_sha256 pub fn suite_chacha20_sha256() -> int — TLS_CHACHA20_POLY1305_SHA256 (0x1303) — the ONE cipher suite this profile offers and accepts (RFC 8446 §9.1 MTI; the suite sc17/sc20 built). std.x.tls.client.scheme_ed25519 pub fn scheme_ed25519() -> int — SignatureScheme ed25519 (0x0807) — first-class: CertificateVerify VERIFIES under it (sc18's verifier). std.x.tls.client.scheme_ecdsa_p256_sha256 pub fn scheme_ecdsa_p256_sha256() -> int — SignatureScheme ecdsa_secp256r1_sha256 (0x0403) — verifies via sc23's p256.verify_der (the sc21 "verify nothing" posture retired for this scheme too). std.x.tls.client.scheme_ecdsa_p384_sha384 pub fn scheme_ecdsa_p384_sha384() -> int — SignatureScheme ecdsa_secp384r1_sha384 (0x0503) — verifies via sc79's p384.verify_der against a P-384 leaf key. std.x.tls.client.scheme_rsa_pss_sha256 pub fn scheme_rsa_pss_sha256() -> int — SignatureScheme rsa_pss_rsae_sha256 (0x0804) — RFC 8446 §9.1's MTI RSA scheme; verifies since sc79 via rsa.verify_pss (SHA-256, MGF1 over SHA-256, a 32-byte salt) against an rsaEncryption leaf key. std.x.tls.client.scheme_rsa_pss_sha384 pub fn scheme_rsa_pss_sha384() -> int — SignatureScheme rsa_pss_rsae_sha384 (0x0805) — rsa.verify_pss with SHA-384 and a 48-byte salt. std.x.tls.client.scheme_rsa_pss_sha512 pub fn scheme_rsa_pss_sha512() -> int — SignatureScheme rsa_pss_rsae_sha512 (0x0806) — rsa.verify_pss with SHA-512 and a 64-byte salt. std.x.tls.client.signature_schemes pub fn signature_schemes() -> List[int] — The signature_algorithms this client offers (RFC 8446 §4.2.3), in preference order: ed25519, ecdsa_secp256r1_sha256, ecdsa_secp384r1_sha384, rsa_pss_rsae_sha256, rsa_pss_rsae_sha384, rsa_pss_rsae_sha512 — every scheme verify_certificate_verify can judge, and nothing else (rsa_pss_pss_*, rsa_pkcs1_* and the SHA-1 schemes are not offered). std.x.tls.client.ServerHelloView pub struct ServerHelloView { legacy_version: int, random: List[byte], session_echo: List[byte], cipher_suite: int, compression: int, selected_version: int, key_share_group: int, server_share: List[byte], hello_retry: bool, } — A parsed ServerHello — the fields the client judges. std.x.tls.client.parse_server_hello pub fn parse_server_hello(msg: List[byte]) -> ServerHelloView ! {decode_error} — Parse a complete ServerHello wire message (4-byte handshake header included) into its view (§4.1.3). std.x.tls.client.check_negotiation pub fn check_negotiation(v: ServerHelloView) -> int ! { downgrade, handshake_failure, illegal_parameter, unexpected_message, } — Judge a parsed ServerHello against THIS profile (§4.1.3's checks, each a named refusal): downgrade — the sentinel randoms, an absent supported_versions, or a selected_version that is not 0x0304 (a TLS 1.2-shaped answer refuses by THIS name, RFC 8446 §4.1.3's downgrade protection); unexpected_message — the HelloRetryRequest sentinel (one key share is offered, a second flight is outside the profile); illegal_parameter — a legacy_version that is not 0x0303, a nonzero compression method, a key_share group that is not x25519(29) or a share that is not 32 bytes; handshake_failure — a cipher suite other than 0x1303. std.x.tls.client.check_encrypted_extensions pub fn check_encrypted_extensions(msg: List[byte]) -> int ! {decode_error} — Validate an EncryptedExtensions wire message's structure (§4.3.1): header, one uint16-prefixed extensions vector filling the body, each extension well-formed. std.x.tls.client.certificate_chain_of pub fn certificate_chain_of(msg: List[byte]) -> List[byte] ! {decode_error} — The peer's certificate chain out of a Certificate wire message (§4.4.2): the CertificateEntry cert_data blobs CONCATENATED, leaf first — exactly cert.validate_chain's chain currency. std.x.tls.client.CertVerifyView pub struct CertVerifyView { scheme: int, sig: List[byte], } — A parsed CertificateVerify: the SignatureScheme and the raw signature bytes. std.x.tls.client.certificate_verify_of pub fn certificate_verify_of(msg: List[byte]) -> CertVerifyView ! {decode_error} — Parse a CertificateVerify wire message (§4.4.3): scheme (uint16) + uint16-prefixed signature filling the body. std.x.tls.client.finished_of pub fn finished_of(msg: List[byte]) -> List[byte] ! {decode_error} — The verify_data out of a Finished wire message (§4.4.4): the body, which for this profile's SHA-256 must be exactly 32 bytes. std.x.tls.client.verify_certificate_verify pub fn verify_certificate_verify( spki_alg: str, spki_key: List[byte], scheme: int, sig: List[byte], transcript_hash: List[byte], ) -> int ! {unsupported_alg, bad_signature, weak_key} — Verify a server CertificateVerify signature (§4.4.3) against the validated leaf's SPKI: spki_alg/spki_key are the leaf's (cert.Cert's fields), transcript_hash is the running hash THROUGH Certificate (CertificateVerify itself excluded), scheme/ sig are the wire message's. std.x.tls.client.Pending pub struct Pending { fd: int, scalar: List[byte], hostname: str, anchors: List[byte], now: int, transcript: List[byte], } — The state between begin and complete: the ClientHello is on the wire, nothing has been read. std.x.tls.client.begin pub fn begin( take sock: net.Socket, hostname: str, anchors: List[byte], now: int, client_random: List[byte], key_seed: List[byte], ) -> Pending ! {closed, io} — PHASE ONE: take ownership of a connected socket (the CALLER dialed — net.connect is the caller's line), build and send the ClientHello, return without reading. std.x.tls.client.Client pub struct Client { fd: int, write_key: List[byte], write_iv: List[byte], write_seq: int, read_key: List[byte], read_iv: List[byte], read_seq: int, } — An established TLS 1.3 connection: the application-traffic keys and sequence numbers over the caller's socket. std.x.tls.client.complete pub fn complete(take p: Pending) -> Client ! { closed, timeout, io, decode_error, bad_record_mac, unexpected_message, illegal_parameter, downgrade, handshake_failure, decrypt_error, zero, der, unsupported_alg, bad_signature, expired, not_yet_valid, name_mismatch, not_ca, issuer_mismatch, unknown_critical, weak_key, bad_usage, name_constraints, } — PHASE TWO: read the server flight, verify EVERYTHING, send the client Finished, answer the established Client. std.x.tls.client.read pub fn read(mut c: Client) -> List[byte] ! { closed, timeout, bad_record_mac, decode_error, unexpected_message, io, } — One record's application data, deprotected. std.x.tls.client.write pub fn write(mut c: Client, data: List[byte]) -> () ! {closed, invalid, io} — Seal data as one application-data record and send it. std.x.tls.client.close pub fn close(take c: Client) -> () ! {io} — Close the connection, consuming the Client: a close_notify alert goes out under the write keys (best-effort — a peer that already vanished does not un-close the socket), then the socket closes. std.x.tls.client.named pub fn named[T]( v: T ! { closed, timeout, io, invalid, decode_error, bad_record_mac, unexpected_message, illegal_parameter, downgrade, handshake_failure, decrypt_error, zero, der, unsupported_alg, bad_signature, expired, not_yet_valid, name_mismatch, not_ca, issuer_mismatch, unknown_critical, weak_key, bad_usage, name_constraints, }, ) -> T ! {Row(str)} — The value of v, or the NAME of the row that refused it, coarsened into the single payload-carrying tag Row(str) — ONE handler arm at the consumer instead of this module's twenty-three. std.x.tls.client.row_name pub fn row_name[T]( v: T ! { closed, timeout, io, invalid, decode_error, bad_record_mac, unexpected_message, illegal_parameter, downgrade, handshake_failure, decrypt_error, zero, der, unsupported_alg, bad_signature, expired, not_yet_valid, name_mismatch, not_ca, issuer_mismatch, unknown_critical, weak_key, bad_usage, name_constraints, }, ) -> str — The NAME of the row that refused v, or "ok" when v carries a value — the marking form, for a caller that wants the WORD and not the value.