@reclaimprotocol/tls
Version:
TLS 1.2/1.3 for any JavaScript Environment
26 lines (25 loc) • 895 B
TypeScript
import type { CipherSuite, Key, TLSProtocolVersion } from '../types/index.ts';
import type { PacketHeaderOptions } from './packets.ts';
type WrappedRecordMacGenOptions = {
macKey?: Key;
recordNumber: number | undefined;
cipherSuite: CipherSuite;
version: TLSProtocolVersion;
} & ({
recordHeaderOpts: PacketHeaderOptions;
} | {
recordHeader: Uint8Array;
});
type WrappedRecordCipherOptions = {
iv: Uint8Array;
key: Key;
} & WrappedRecordMacGenOptions;
export declare function decryptWrappedRecord(encryptedData: Uint8Array, opts: WrappedRecordCipherOptions): Promise<{
plaintext: Uint8Array<ArrayBufferLike>;
iv: Uint8Array<ArrayBufferLike>;
}>;
export declare function encryptWrappedRecord(plaintext: Uint8Array, opts: WrappedRecordCipherOptions): Promise<{
ciphertext: Uint8Array<ArrayBufferLike>;
iv: Uint8Array<ArrayBufferLike>;
}>;
export {};