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

39 lines (38 loc) 1.78 kB
import { Decoder } from "./codec/tlsDecoder.js"; import { Encoder } from "./codec/tlsEncoder.js"; import { CiphersuiteImpl, CiphersuiteName } from "./crypto/ciphersuite.js"; import { Hash } from "./crypto/hash.js"; import { Signature } from "./crypto/signature.js"; import { Extension } from "./extension.js"; import { ProtocolVersionName } from "./protocolVersion.js"; import { LeafNodeKeyPackage } from "./leafNode.js"; import { Capabilities } from "./capabilities.js"; import { Lifetime } from "./lifetime.js"; import { Credential } from "./credential.js"; type KeyPackageTBS = { version: ProtocolVersionName; cipherSuite: CiphersuiteName; initKey: Uint8Array; leafNode: LeafNodeKeyPackage; extensions: Extension[]; }; export declare const encodeKeyPackageTBS: Encoder<KeyPackageTBS>; export declare const decodeKeyPackageTBS: Decoder<KeyPackageTBS>; export type KeyPackage = KeyPackageTBS & { signature: Uint8Array; }; export declare const encodeKeyPackage: Encoder<KeyPackage>; export declare const decodeKeyPackage: Decoder<KeyPackage>; export declare function signKeyPackage(tbs: KeyPackageTBS, signKey: Uint8Array, s: Signature): Promise<KeyPackage>; export declare function verifyKeyPackage(kp: KeyPackage, s: Signature): Promise<boolean>; export declare function makeKeyPackageRef(value: KeyPackage, h: Hash): Promise<Uint8Array<ArrayBufferLike>>; export interface PrivateKeyPackage { initPrivateKey: Uint8Array; hpkePrivateKey: Uint8Array; signaturePrivateKey: Uint8Array; } export declare function generateKeyPackage(credential: Credential, capabilities: Capabilities, lifetime: Lifetime, extensions: Extension[], cs: CiphersuiteImpl): Promise<{ publicPackage: KeyPackage; privatePackage: PrivateKeyPackage; }>; export {};