/** * Key Epoch Manager for BrightChat E2E Encryption. * * Manages versioned symmetric keys per communication context. * Each key rotation creates a new epoch. Messages record which * epoch they were encrypted under. * * epoch 0 = initial key, epoch N = Nth rotation. * * Requirements: 3.1, 3.2, 3.3, 3.4, 5.3, 2.2, 5.2 */ /** * Tracks key epochs for a communication context. * * encryptedEpochKeys: Map> */ export interface IKeyEpochState { currentEpoch: number; /** epoch → raw symmetric key (server-side only, in-memory) */ epochKeys: Map; /** epoch → memberId → wrapped key (persisted) */ encryptedEpochKeys: Map>; } export declare class KeyEpochManager { /** * Initialize epoch state for a new context. * Creates epoch 0 with the given symmetric key, wraps for all members. */ static createInitial(symmetricKey: Uint8Array, memberIds: string[], encryptKeyForMembers: (ids: string[], key: Uint8Array) => Map): IKeyEpochState; /** * Rotate: increment epoch, add new key, delete removed member from ALL epochs, * re-wrap ALL epoch keys for remaining members. */ static rotate(state: IKeyEpochState, newKey: Uint8Array, remainingMemberIds: string[], removedMemberId: string, encryptKeyForMembers: (ids: string[], key: Uint8Array) => Map): IKeyEpochState; /** * Add a member: wrap ALL epoch keys for the new member * so they can read history. */ static addMember(state: IKeyEpochState, newMemberId: string, encryptKeyForMember: (memberId: string, key: Uint8Array) => Uint8Array): void; } //# sourceMappingURL=keyEpochManager.d.ts.map