Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions modules/e2ee/ExternallyManagedKeyHandler.js

This file was deleted.

34 changes: 34 additions & 0 deletions modules/e2ee/ExternallyManagedKeyHandler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import JitsiConference from '../../JitsiConference';
import { KeyHandler } from './KeyHandler';

/**
* This module integrates {@link E2EEContext} with {external} in order to set the keys for encryption.
*/

/**
* Information about an encryption key for E2EE.
*/
export interface KeyInfo {
encryptionKey: boolean | Uint8Array<ArrayBufferLike>;
index: number;
}

/**
* This module integrates {@link E2EEContext} with an external key provider
* in order to set the keys for encryption.
*/
export class ExternallyManagedKeyHandler extends KeyHandler {
constructor(conference: JitsiConference) {
// The `sharedKey: true` flag tells the parent KeyHandler that
// one key is used across the whole conference.
super(conference, { sharedKey: true });
}

/**
* Sets the key and index for End-to-End encryption.
*/
setKey(keyInfo: KeyInfo): void {
this.e2eeCtx.setKey(undefined, keyInfo.encryptionKey, keyInfo.index);
}
}