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.74 kB
import { Decoder } from "./codec/tlsDecoder"; import { Encoder } from "./codec/tlsEncoder"; import { CiphersuiteImpl, CiphersuiteName } from "./crypto/ciphersuite"; import { Hash } from "./crypto/hash"; import { Signature } from "./crypto/signature"; import { Extension } from "./extension"; import { ProtocolVersionName } from "./protocolVersion"; import { LeafNodeKeyPackage } from "./leafNode"; import { Capabilities } from "./capabilities"; import { Lifetime } from "./lifetime"; import { Credential } from "./credential"; 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 type 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 {};