|
| 1 | +import { Constrained } from "../src/dep.ts"; |
1 | 2 | import { Enum } from "../src/enum.js"; |
2 | 3 |
|
3 | 4 | /** |
4 | 5 | * Represents the PskKeyExchangeMode, as defined in RFC 8446, Section 4.4.2. |
5 | 6 | * @see https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.7. |
6 | 7 | */ |
7 | 8 | export declare class PskKeyExchangeMode extends Enum { |
8 | | - /** PSK-only key establishment. The server MUST NOT supply a "key_share" value. */ |
9 | | - static PSK_KE: PskKeyExchangeMode; |
| 9 | + /** PSK-only key establishment. The server MUST NOT supply a "key_share" value. */ |
| 10 | + static PSK_KE: PskKeyExchangeMode; |
10 | 11 |
|
11 | | - /** PSK with (EC)DHE key establishment. Both the client and server MUST supply "key_share" values. */ |
12 | | - static PSK_DHE_KE: PskKeyExchangeMode; |
| 12 | + /** PSK with (EC)DHE key establishment. Both the client and server MUST supply "key_share" values. */ |
| 13 | + static PSK_DHE_KE: PskKeyExchangeMode; |
13 | 14 |
|
14 | | - /** |
15 | | - * Creates a PskKeyExchangeMode instance from an octet. |
16 | | - * @param octet - The octet value (Uint8Array) to parse. |
17 | | - * @returns {PskKeyExchangeMode} - The corresponding PskKeyExchangeMode instance. |
18 | | - * @throws {Error} - If the octet is not a valid PskKeyExchangeMode type. |
19 | | - */ |
20 | | - static from(octet: Uint8Array): PskKeyExchangeMode; |
| 15 | + /** |
| 16 | + * Creates a PskKeyExchangeMode instance from an octet. |
| 17 | + * @param octet - The octet value (Uint8Array) to parse. |
| 18 | + * @returns {PskKeyExchangeMode} - The corresponding PskKeyExchangeMode instance. |
| 19 | + * @throws {Error} - If the octet is not a valid PskKeyExchangeMode type. |
| 20 | + */ |
| 21 | + static from(octet: Uint8Array): PskKeyExchangeMode; |
21 | 22 |
|
22 | | - /** Returns the bit value for the mode (8). */ |
23 | | - readonly bit: number; |
| 23 | + /** Returns the bit value for the mode (8). */ |
| 24 | + readonly bit: number; |
24 | 25 |
|
25 | | - /** Returns the Uint8Array representation of the mode. */ |
26 | | - readonly Uint8: Uint8Array; |
| 26 | + /** Returns the Uint8Array representation of the mode. */ |
| 27 | + readonly Uint8: Uint8Array; |
| 28 | +} |
| 29 | + |
| 30 | +export declare class PskKeyExchangeModes extends Constrained { |
| 31 | + /** |
| 32 | + * Parses a `PskKeyExchangeModes` instance from a `Uint8Array`. |
| 33 | + * @param array - The input array containing PSK key exchange mode data. |
| 34 | + * @returns A new instance of `PskKeyExchangeModes`. |
| 35 | + * @throws {Error} If the input array is invalid or incomplete. |
| 36 | + */ |
| 37 | + static from(array: Uint8Array): PskKeyExchangeModes; |
| 38 | + |
| 39 | + /** |
| 40 | + * Constructs a `PskKeyExchangeModes` instance. |
| 41 | + * @param ke_modes - A list of PSK key exchange modes. |
| 42 | + * @throws {Error} If the constraints are not satisfied. |
| 43 | + */ |
| 44 | + constructor(...ke_modes: PskKeyExchangeMode[]); |
| 45 | + |
| 46 | + /** |
| 47 | + * The list of PSK key exchange modes. |
| 48 | + */ |
| 49 | + readonly ke_modes: PskKeyExchangeMode[]; |
27 | 50 | } |
0 commit comments