UNPKG

ts-mls

Version:

[![CI](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml/badge.svg)](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/ts-mls.svg)](https://badge.fury.io/js/ts-mls) [![Coverage Status](https://co

28 lines 1.3 kB
import { decodeCredentialType, encodeCredentialType } from "./credentialType.js"; import { decodeCiphersuite, encodeCiphersuite } from "./crypto/ciphersuite.js"; import { decodeProtocolVersion, encodeProtocolVersion } from "./protocolVersion.js"; import { contramapEncoders } from "./codec/tlsEncoder.js"; import { mapDecoders } from "./codec/tlsDecoder.js"; import { decodeVarLenType, encodeVarLenType } from "./codec/variableLength.js"; import { decodeUint16, encodeUint16 } from "./codec/number.js"; export const encodeCapabilities = contramapEncoders([ encodeVarLenType(encodeProtocolVersion), encodeVarLenType(encodeCiphersuite), encodeVarLenType(encodeUint16), encodeVarLenType(encodeUint16), encodeVarLenType(encodeCredentialType), ], (cap) => [cap.versions, cap.ciphersuites, cap.extensions, cap.proposals, cap.credentials]); export const decodeCapabilities = mapDecoders([ decodeVarLenType(decodeProtocolVersion), decodeVarLenType(decodeCiphersuite), decodeVarLenType(decodeUint16), decodeVarLenType(decodeUint16), decodeVarLenType(decodeCredentialType), ], (versions, ciphersuites, extensions, proposals, credentials) => ({ versions, ciphersuites, extensions, proposals, credentials, })); //# sourceMappingURL=capabilities.js.map