041d41a5fe
* Add checkbox for e2ee * add also to custom tab * fix SSR
16 lines
505 B
TypeScript
16 lines
505 B
TypeScript
// just for demonstration purposes, extremely insecure
|
|
|
|
import { BaseKeyProvider, createKeyMaterialFromString } from 'livekit-client';
|
|
|
|
export class DummyKeyProvider extends BaseKeyProvider {
|
|
readonly participantKeys = new Map([
|
|
['dev1', 'dev1key'],
|
|
['dev2', 'dev2key'],
|
|
]);
|
|
|
|
async setKey(participantId: string) {
|
|
// @ts-ignore
|
|
const cryptoKey = await createKeyMaterialFromString(this.participantKeys.get(participantId));
|
|
this.onSetEncryptionKey(cryptoKey, participantId);
|
|
}
|
|
}
|