import type { ServerNameList } from './0_server_name'; import { ServerNameExtension } from './0_server_name'; import type { ParsedSupportedGroups } from './10_supported_groups'; import { SupportedGroupsExtension } from './10_supported_groups'; import type { ParsedECPointFormats } from './11_ec_point_formats'; import { ECPointFormatsExtension } from './11_ec_point_formats'; import type { SignatureAlgorithms } from './13_signature_algorithms'; import { SignatureAlgorithmsExtension } from './13_signature_algorithms'; export declare const TLSExtensionsHandlers: { readonly server_name: typeof ServerNameExtension; readonly signature_algorithms: typeof SignatureAlgorithmsExtension; readonly supported_groups: typeof SupportedGroupsExtension; readonly ec_point_formats: typeof ECPointFormatsExtension; }; export type SupportedTLSExtension = keyof typeof TLSExtensionsHandlers; export type ParsedExtension = { type: 'server_name'; data: ServerNameList; raw: Uint8Array; } | { type: 'signature_algorithms'; data: SignatureAlgorithms; raw: Uint8Array; } | { type: 'ec_point_formats'; data: ParsedECPointFormats; raw: Uint8Array; } | { type: 'supported_groups'; data: ParsedSupportedGroups; raw: Uint8Array; }; /** * The extensions in a ClientHello message are encoded as follows: * * struct { * ExtensionType extension_type; * opaque extension_data<0..2^16-1>; * } Extension; * * The overall extensions structure is: * * Extension extensions<0..2^16-1>; * * This means: * • There's a 2-byte length field for the entire extensions block. * • Followed by zero or more individual extensions. * * Binary Data Layout * * +-----------------------------+ * | Extension 1 Type (2 bytes) | * +-----------------------------+ * | Extension 1 Length (2 bytes)| * +-----------------------------+ * | Extension 1 Data (variable) | * +-----------------------------+ * | Extension 2 Type (2 bytes) | * +-----------------------------+ * | Extension 2 Length (2 bytes)| * +-----------------------------+ * | Extension 2 Data (variable) | * +-----------------------------+ * | ... (more extensions) | * +-----------------------------+ * * @param data * @returns */ export declare function parseClientHelloExtensions(data: Uint8Array): ParsedExtension[];