livekit-client 1.11.3 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -3
- package/dist/livekit-client.e2ee.worker.js +2 -0
- package/dist/livekit-client.e2ee.worker.js.map +1 -0
- package/dist/livekit-client.e2ee.worker.mjs +1525 -0
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -0
- package/dist/livekit-client.esm.mjs +1462 -660
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +4 -1
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/turn.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/websocket.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts +45 -0
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -0
- package/dist/src/e2ee/KeyProvider.d.ts +42 -0
- package/dist/src/e2ee/KeyProvider.d.ts.map +1 -0
- package/dist/src/e2ee/constants.d.ts +14 -0
- package/dist/src/e2ee/constants.d.ts.map +1 -0
- package/dist/src/e2ee/errors.d.ts +11 -0
- package/dist/src/e2ee/errors.d.ts.map +1 -0
- package/dist/src/e2ee/index.d.ts +4 -0
- package/dist/src/e2ee/index.d.ts.map +1 -0
- package/dist/src/e2ee/types.d.ts +129 -0
- package/dist/src/e2ee/types.d.ts.map +1 -0
- package/dist/src/e2ee/utils.d.ts +24 -0
- package/dist/src/e2ee/utils.d.ts.map +1 -0
- package/dist/src/e2ee/worker/FrameCryptor.d.ts +175 -0
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -0
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts +46 -0
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -0
- package/dist/src/e2ee/worker/e2ee.worker.d.ts +2 -0
- package/dist/src/e2ee/worker/e2ee.worker.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/logger.d.ts +4 -1
- package/dist/src/logger.d.ts.map +1 -1
- package/dist/src/options.d.ts +5 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/proto/livekit_models.d.ts +2 -2
- package/dist/src/proto/livekit_models.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts +3 -1
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +17 -3
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +10 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +14 -2
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +9 -2
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +1 -0
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +3 -2
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/TrackPublication.d.ts +3 -0
- package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/facingMode.d.ts +41 -0
- package/dist/src/room/track/facingMode.d.ts.map +1 -0
- package/dist/src/room/track/options.d.ts +2 -2
- package/dist/src/room/track/options.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts +5 -35
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +2 -0
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/MockMediaStreamTrack.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +4 -1
- package/dist/ts4.2/src/e2ee/E2eeManager.d.ts +45 -0
- package/dist/ts4.2/src/e2ee/KeyProvider.d.ts +42 -0
- package/dist/ts4.2/src/e2ee/constants.d.ts +14 -0
- package/dist/ts4.2/src/e2ee/errors.d.ts +11 -0
- package/dist/ts4.2/src/e2ee/index.d.ts +4 -0
- package/dist/ts4.2/src/e2ee/types.d.ts +129 -0
- package/dist/ts4.2/src/e2ee/utils.d.ts +24 -0
- package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +175 -0
- package/dist/ts4.2/src/e2ee/worker/ParticipantKeyHandler.d.ts +46 -0
- package/dist/ts4.2/src/e2ee/worker/e2ee.worker.d.ts +2 -0
- package/dist/ts4.2/src/index.d.ts +2 -0
- package/dist/ts4.2/src/logger.d.ts +4 -1
- package/dist/ts4.2/src/options.d.ts +5 -0
- package/dist/ts4.2/src/proto/livekit_models.d.ts +2 -2
- package/dist/ts4.2/src/room/PCTransport.d.ts +3 -1
- package/dist/ts4.2/src/room/RTCEngine.d.ts +17 -3
- package/dist/ts4.2/src/room/Room.d.ts +10 -1
- package/dist/ts4.2/src/room/events.d.ts +14 -2
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +9 -2
- package/dist/ts4.2/src/room/participant/Participant.d.ts +1 -0
- package/dist/ts4.2/src/room/track/LocalTrack.d.ts +3 -2
- package/dist/ts4.2/src/room/track/TrackPublication.d.ts +3 -0
- package/dist/ts4.2/src/room/track/facingMode.d.ts +41 -0
- package/dist/ts4.2/src/room/track/options.d.ts +6 -6
- package/dist/ts4.2/src/room/track/utils.d.ts +5 -35
- package/dist/ts4.2/src/room/utils.d.ts +2 -0
- package/package.json +17 -7
- package/src/api/SignalClient.ts +28 -9
- package/src/connectionHelper/checks/turn.ts +1 -0
- package/src/connectionHelper/checks/websocket.ts +1 -0
- package/src/e2ee/E2eeManager.ts +374 -0
- package/src/e2ee/KeyProvider.ts +77 -0
- package/src/e2ee/constants.ts +40 -0
- package/src/e2ee/errors.ts +16 -0
- package/src/e2ee/index.ts +3 -0
- package/src/e2ee/types.ts +160 -0
- package/src/e2ee/utils.ts +127 -0
- package/src/e2ee/worker/FrameCryptor.test.ts +21 -0
- package/src/e2ee/worker/FrameCryptor.ts +614 -0
- package/src/e2ee/worker/ParticipantKeyHandler.ts +129 -0
- package/src/e2ee/worker/e2ee.worker.ts +217 -0
- package/src/e2ee/worker/tsconfig.json +6 -0
- package/src/index.ts +2 -0
- package/src/logger.ts +10 -2
- package/src/options.ts +6 -0
- package/src/proto/livekit_models.ts +12 -12
- package/src/room/PCTransport.ts +39 -9
- package/src/room/RTCEngine.ts +127 -34
- package/src/room/Room.ts +83 -30
- package/src/room/defaults.ts +1 -1
- package/src/room/events.ts +14 -0
- package/src/room/participant/LocalParticipant.ts +82 -10
- package/src/room/participant/Participant.ts +4 -0
- package/src/room/track/LocalAudioTrack.ts +11 -4
- package/src/room/track/LocalTrack.ts +50 -43
- package/src/room/track/LocalVideoTrack.ts +5 -3
- package/src/room/track/RemoteVideoTrack.ts +2 -2
- package/src/room/track/TrackPublication.ts +9 -1
- package/src/room/track/facingMode.test.ts +30 -0
- package/src/room/track/facingMode.ts +103 -0
- package/src/room/track/options.ts +3 -2
- package/src/room/track/utils.test.ts +1 -30
- package/src/room/track/utils.ts +16 -91
- package/src/room/utils.ts +5 -0
- package/src/room/worker.d.ts +4 -0
- package/src/test/MockMediaStreamTrack.ts +1 -0
@@ -19,6 +19,7 @@ export interface SignalOptions {
|
|
19
19
|
publishOnly?: string;
|
20
20
|
adaptiveStream?: boolean;
|
21
21
|
maxRetries: number;
|
22
|
+
e2eeEnabled: boolean;
|
22
23
|
}
|
23
24
|
type SignalMessage = SignalRequest['message'];
|
24
25
|
/** @internal */
|
@@ -61,7 +62,9 @@ export declare class SignalClient {
|
|
61
62
|
constructor(useJSON?: boolean);
|
62
63
|
join(url: string, token: string, opts: SignalOptions, abortSignal?: AbortSignal): Promise<JoinResponse>;
|
63
64
|
reconnect(url: string, token: string, sid?: string, reason?: ReconnectReason): Promise<ReconnectResponse | void>;
|
64
|
-
connect
|
65
|
+
private connect;
|
66
|
+
/** @internal */
|
67
|
+
resetCallbacks: () => void;
|
65
68
|
close(): Promise<void>;
|
66
69
|
sendOffer(offer: RTCSessionDescriptionInit): void;
|
67
70
|
sendAnswer(answer: RTCSessionDescriptionInit): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SignalClient.d.ts","sourceRoot":"","sources":["../../../src/api/SignalClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,eAAe,EACf,eAAe,EACf,IAAI,EACJ,WAAW,EACX,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EAEb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,UAAU,WAAW;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,eAAe;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,eAAe;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"SignalClient.d.ts","sourceRoot":"","sources":["../../../src/api/SignalClient.ts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kBAAkB;IAO9C,aAAa,CAAC,IAAI,EAAE,SAAS;IAO7B,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE;IAU5D,iCAAiC,CAAC,eAAe,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE;IAU/F,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB;IAO/C,QAAQ;IAiBR,SAAS;IAUH,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,GAAE,OAAe;IAoCpE,OAAO,CAAC,oBAAoB;IAmF5B,cAAc;YAUA,aAAa;IAU3B,OAAO,CAAC,aAAa;IAIrB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,iBAAiB;CAO1B;AAoBD,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,qBAAqB,GAAG,yBAAyB,GACrD,kBAAkB,CAMpB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/turn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,SAAU,SAAQ,OAAO;IACpC,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/turn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,SAAU,SAAQ,OAAO;IACpC,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CA6C/B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/websocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,cAAe,SAAQ,OAAO;IACzC,IAAI,WAAW,IAAI,MAAM,CAExB;cAEe,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/websocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,cAAe,SAAQ,OAAO;IACzC,IAAI,WAAW,IAAI,MAAM,CAExB;cAEe,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAczC"}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
2
|
+
import type RTCEngine from '../room/RTCEngine';
|
3
|
+
import type Room from '../room/Room';
|
4
|
+
import type { E2EEManagerCallbacks, E2EEOptions } from './types';
|
5
|
+
/**
|
6
|
+
* @experimental
|
7
|
+
*/
|
8
|
+
export declare class E2EEManager extends EventEmitter<E2EEManagerCallbacks> {
|
9
|
+
protected worker: Worker;
|
10
|
+
protected room?: Room;
|
11
|
+
private encryptionEnabled;
|
12
|
+
private keyProvider;
|
13
|
+
get isEnabled(): boolean;
|
14
|
+
constructor(options: E2EEOptions);
|
15
|
+
/**
|
16
|
+
* @internal
|
17
|
+
*/
|
18
|
+
setup(room: Room): void;
|
19
|
+
/**
|
20
|
+
* @internal
|
21
|
+
*/
|
22
|
+
setParticipantCryptorEnabled(enabled: boolean, participantId?: string): Promise<void>;
|
23
|
+
private onWorkerMessage;
|
24
|
+
private onWorkerError;
|
25
|
+
setupEngine(engine: RTCEngine): void;
|
26
|
+
private setupEventListeners;
|
27
|
+
private postRatchetRequest;
|
28
|
+
private postKey;
|
29
|
+
private postRTPMap;
|
30
|
+
private setupE2EEReceiver;
|
31
|
+
private setupE2EESender;
|
32
|
+
/**
|
33
|
+
* Handles the given {@code RTCRtpReceiver} by creating a {@code TransformStream} which will inject
|
34
|
+
* a frame decoder.
|
35
|
+
*
|
36
|
+
*/
|
37
|
+
private handleReceiver;
|
38
|
+
/**
|
39
|
+
* Handles the given {@code RTCRtpSender} by creating a {@code TransformStream} which will inject
|
40
|
+
* a frame encoder.
|
41
|
+
*
|
42
|
+
*/
|
43
|
+
private handleSender;
|
44
|
+
}
|
45
|
+
//# sourceMappingURL=E2eeManager.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"E2eeManager.d.ts","sourceRoot":"","sources":["../../../src/e2ee/E2eeManager.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAGzC,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AAUrC,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EAWZ,MAAM,SAAS,CAAC;AAIjB;;GAEG;AACH,qBAAa,WAAY,SAAQ,YAAY,CAAC,oBAAoB,CAAC;IACjE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAEtB,OAAO,CAAC,iBAAiB,CAAU;IAEnC,OAAO,CAAC,WAAW,CAAkB;IAErC,IAAI,SAAS,YAEZ;gBAEW,OAAO,EAAE,WAAW;IAOhC;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,IAAI;IA0BhB;;OAEG;IACG,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,MAAM;IAc3E,OAAO,CAAC,eAAe,CA+BrB;IAEF,OAAO,CAAC,aAAa,CAGnB;IAEK,WAAW,CAAC,MAAM,EAAE,SAAS;IAMpC,OAAO,CAAC,mBAAmB;IAgD3B,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,OAAO;IAef,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,eAAe;IAQvB;;;;OAIG;YACW,cAAc;IAiE5B;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAyCrB"}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
2
|
+
import type { KeyInfo, KeyProviderCallbacks, KeyProviderOptions } from './types';
|
3
|
+
/**
|
4
|
+
* @experimental
|
5
|
+
*/
|
6
|
+
export declare class BaseKeyProvider extends EventEmitter<KeyProviderCallbacks> {
|
7
|
+
private keyInfoMap;
|
8
|
+
private options;
|
9
|
+
constructor(options?: Partial<KeyProviderOptions>);
|
10
|
+
/**
|
11
|
+
* callback to invoke once a key has been set for a participant
|
12
|
+
* @param key
|
13
|
+
* @param participantId
|
14
|
+
* @param keyIndex
|
15
|
+
*/
|
16
|
+
protected onSetEncryptionKey(key: CryptoKey, participantId?: string, keyIndex?: number): void;
|
17
|
+
/**
|
18
|
+
* callback being invoked after a ratchet request has been performed on the local participant
|
19
|
+
* that surfaces the new key material.
|
20
|
+
* @param material
|
21
|
+
* @param keyIndex
|
22
|
+
*/
|
23
|
+
protected onKeyRatcheted: (material: CryptoKey, keyIndex?: number) => void;
|
24
|
+
getKeys(): KeyInfo[];
|
25
|
+
getOptions(): KeyProviderOptions;
|
26
|
+
ratchetKey(participantId?: string, keyIndex?: number): void;
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* A basic KeyProvider implementation intended for a single shared
|
30
|
+
* passphrase between all participants
|
31
|
+
* @experimental
|
32
|
+
*/
|
33
|
+
export declare class ExternalE2EEKeyProvider extends BaseKeyProvider {
|
34
|
+
ratchetInterval: number | undefined;
|
35
|
+
constructor(options?: Partial<Omit<KeyProviderOptions, 'sharedKey'>>);
|
36
|
+
/**
|
37
|
+
* Accepts a passphrase that's used to create the crypto keys
|
38
|
+
* @param key
|
39
|
+
*/
|
40
|
+
setKey(key: string): Promise<void>;
|
41
|
+
}
|
42
|
+
//# sourceMappingURL=KeyProvider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"KeyProvider.d.ts","sourceRoot":"","sources":["../../../src/e2ee/KeyProvider.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGjF;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAY,CAAC,oBAAoB,CAAC;IACrE,OAAO,CAAC,UAAU,CAAuB;IAEzC,OAAO,CAAC,OAAO,CAAqB;gBAExB,OAAO,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAOrD;;;;;OAKG;IACH,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAMtF;;;;;OAKG;IACH,SAAS,CAAC,cAAc,aAAc,SAAS,aAAa,MAAM,UAEhE;IAEF,OAAO;IAIP,UAAU;IAIV,UAAU,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAGrD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,eAAe;IAC1D,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;gBAExB,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAM;IAKxE;;;OAGG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM;CAIzB"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { KeyProviderOptions } from './types';
|
2
|
+
export declare const ENCRYPTION_ALGORITHM = "AES-GCM";
|
3
|
+
export declare const KEYRING_SIZE = 16;
|
4
|
+
export declare const UNENCRYPTED_BYTES: {
|
5
|
+
readonly key: 10;
|
6
|
+
readonly delta: 3;
|
7
|
+
readonly audio: 1;
|
8
|
+
readonly empty: 0;
|
9
|
+
};
|
10
|
+
export declare const IV_LENGTH = 12;
|
11
|
+
export declare const E2EE_FLAG = "lk_e2ee";
|
12
|
+
export declare const SALT = "LKFrameEncryptionKey";
|
13
|
+
export declare const KEY_PROVIDER_DEFAULTS: KeyProviderOptions;
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/e2ee/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAK9C,eAAO,MAAM,YAAY,KAAK,CAAC;AAY/B,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAIX,eAAO,MAAM,SAAS,KAAK,CAAC;AAG5B,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,eAAO,MAAM,IAAI,yBAAyB,CAAC;AAE3C,eAAO,MAAM,qBAAqB,EAAE,kBAI1B,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { LivekitError } from '../room/errors';
|
2
|
+
export declare enum CryptorErrorReason {
|
3
|
+
InvalidKey = 0,
|
4
|
+
MissingKey = 1,
|
5
|
+
InternalError = 2
|
6
|
+
}
|
7
|
+
export declare class CryptorError extends LivekitError {
|
8
|
+
reason: CryptorErrorReason;
|
9
|
+
constructor(message?: string, reason?: CryptorErrorReason);
|
10
|
+
}
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/e2ee/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,oBAAY,kBAAkB;IAC5B,UAAU,IAAI;IACd,UAAU,IAAI;IACd,aAAa,IAAI;CAClB;AAED,qBAAa,YAAa,SAAQ,YAAY;IAC5C,MAAM,EAAE,kBAAkB,CAAC;gBAEf,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,kBAAqD;CAI5F"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/e2ee/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
@@ -0,0 +1,129 @@
|
|
1
|
+
import type Participant from '../room/participant/Participant';
|
2
|
+
import type { VideoCodec } from '../room/track/options';
|
3
|
+
import type { BaseKeyProvider } from './KeyProvider';
|
4
|
+
import type { CryptorError } from './errors';
|
5
|
+
export interface BaseMessage {
|
6
|
+
kind: string;
|
7
|
+
data?: unknown;
|
8
|
+
}
|
9
|
+
export interface InitMessage extends BaseMessage {
|
10
|
+
kind: 'init';
|
11
|
+
data: {
|
12
|
+
keyProviderOptions: KeyProviderOptions;
|
13
|
+
};
|
14
|
+
}
|
15
|
+
export interface SetKeyMessage extends BaseMessage {
|
16
|
+
kind: 'setKey';
|
17
|
+
data: {
|
18
|
+
participantId?: string;
|
19
|
+
key: CryptoKey;
|
20
|
+
keyIndex?: number;
|
21
|
+
};
|
22
|
+
}
|
23
|
+
export interface RTPVideoMapMessage extends BaseMessage {
|
24
|
+
kind: 'setRTPMap';
|
25
|
+
data: {
|
26
|
+
map: Map<number, VideoCodec>;
|
27
|
+
};
|
28
|
+
}
|
29
|
+
export interface EncodeMessage extends BaseMessage {
|
30
|
+
kind: 'decode' | 'encode';
|
31
|
+
data: {
|
32
|
+
participantId: string;
|
33
|
+
readableStream: ReadableStream;
|
34
|
+
writableStream: WritableStream;
|
35
|
+
trackId: string;
|
36
|
+
codec?: VideoCodec;
|
37
|
+
};
|
38
|
+
}
|
39
|
+
export interface RemoveTransformMessage extends BaseMessage {
|
40
|
+
kind: 'removeTransform';
|
41
|
+
data: {
|
42
|
+
participantId: string;
|
43
|
+
trackId: string;
|
44
|
+
};
|
45
|
+
}
|
46
|
+
export interface UpdateCodecMessage extends BaseMessage {
|
47
|
+
kind: 'updateCodec';
|
48
|
+
data: {
|
49
|
+
participantId: string;
|
50
|
+
trackId: string;
|
51
|
+
codec: VideoCodec;
|
52
|
+
};
|
53
|
+
}
|
54
|
+
export interface RatchetRequestMessage extends BaseMessage {
|
55
|
+
kind: 'ratchetRequest';
|
56
|
+
data: {
|
57
|
+
participantId: string | undefined;
|
58
|
+
keyIndex?: number;
|
59
|
+
};
|
60
|
+
}
|
61
|
+
export interface RatchetMessage extends BaseMessage {
|
62
|
+
kind: 'ratchetKey';
|
63
|
+
data: {
|
64
|
+
keyIndex?: number;
|
65
|
+
material: CryptoKey;
|
66
|
+
};
|
67
|
+
}
|
68
|
+
export interface ErrorMessage extends BaseMessage {
|
69
|
+
kind: 'error';
|
70
|
+
data: {
|
71
|
+
error: Error;
|
72
|
+
};
|
73
|
+
}
|
74
|
+
export interface EnableMessage extends BaseMessage {
|
75
|
+
kind: 'enable';
|
76
|
+
data: {
|
77
|
+
participantId?: string;
|
78
|
+
enabled: boolean;
|
79
|
+
};
|
80
|
+
}
|
81
|
+
export type E2EEWorkerMessage = InitMessage | SetKeyMessage | EncodeMessage | ErrorMessage | EnableMessage | RemoveTransformMessage | RTPVideoMapMessage | UpdateCodecMessage | RatchetRequestMessage | RatchetMessage;
|
82
|
+
export type KeySet = {
|
83
|
+
material: CryptoKey;
|
84
|
+
encryptionKey: CryptoKey;
|
85
|
+
};
|
86
|
+
export type KeyProviderOptions = {
|
87
|
+
sharedKey: boolean;
|
88
|
+
ratchetSalt: string;
|
89
|
+
ratchetWindowSize: number;
|
90
|
+
};
|
91
|
+
export type KeyProviderCallbacks = {
|
92
|
+
setKey: (keyInfo: KeyInfo) => void;
|
93
|
+
ratchetRequest: (participantId?: string, keyIndex?: number) => void;
|
94
|
+
/** currently only emitted for local participant */
|
95
|
+
keyRatcheted: (material: CryptoKey, keyIndex?: number) => void;
|
96
|
+
};
|
97
|
+
export type ParticipantKeyHandlerCallbacks = {
|
98
|
+
keyRatcheted: (material: CryptoKey, keyIndex?: number, participantId?: string) => void;
|
99
|
+
};
|
100
|
+
export type E2EEManagerCallbacks = {
|
101
|
+
participantEncryptionStatusChanged: (enabled: boolean, participant?: Participant) => void;
|
102
|
+
encryptionError: (error: Error) => void;
|
103
|
+
};
|
104
|
+
export declare const EncryptionEvent: {
|
105
|
+
readonly ParticipantEncryptionStatusChanged: "participantEncryptionStatusChanged";
|
106
|
+
readonly Error: "encryptionError";
|
107
|
+
};
|
108
|
+
export type CryptorCallbacks = {
|
109
|
+
cryptorError: (error: CryptorError) => void;
|
110
|
+
};
|
111
|
+
export declare const CryptorEvent: {
|
112
|
+
readonly Error: "cryptorError";
|
113
|
+
};
|
114
|
+
export type KeyInfo = {
|
115
|
+
key: CryptoKey;
|
116
|
+
participantId?: string;
|
117
|
+
keyIndex?: number;
|
118
|
+
};
|
119
|
+
export type E2EEOptions = {
|
120
|
+
keyProvider: BaseKeyProvider;
|
121
|
+
worker: Worker;
|
122
|
+
};
|
123
|
+
export type DecodeRatchetOptions = {
|
124
|
+
/** attempts */
|
125
|
+
ratchetCount: number;
|
126
|
+
/** ratcheted key to try */
|
127
|
+
encryptionKey?: CryptoKey;
|
128
|
+
};
|
129
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/e2ee/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,WAAW;IA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C;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,YAAY,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,kCAAkC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1F,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,YAAY;;CAEf,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,SAAS,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,eAAe,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,gBAAgB;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export declare function isE2EESupported(): boolean;
|
2
|
+
export declare function isScriptTransformSupported(): boolean;
|
3
|
+
export declare function isInsertableStreamSupported(): boolean;
|
4
|
+
export declare function isVideoFrame(frame: RTCEncodedAudioFrame | RTCEncodedVideoFrame): frame is RTCEncodedVideoFrame;
|
5
|
+
export declare function importKey(keyBytes: Uint8Array | ArrayBuffer, algorithm?: string | {
|
6
|
+
name: string;
|
7
|
+
}, usage?: 'derive' | 'encrypt'): Promise<CryptoKey>;
|
8
|
+
export declare function createKeyMaterialFromString(password: string): Promise<CryptoKey>;
|
9
|
+
/**
|
10
|
+
* Derives a set of keys from the master key.
|
11
|
+
* See https://tools.ietf.org/html/draft-omara-sframe-00#section-4.3.1
|
12
|
+
*/
|
13
|
+
export declare function deriveKeys(material: CryptoKey, salt: string): Promise<{
|
14
|
+
material: CryptoKey;
|
15
|
+
encryptionKey: CryptoKey;
|
16
|
+
}>;
|
17
|
+
export declare function createE2EEKey(): Uint8Array;
|
18
|
+
export declare function mimeTypeToVideoCodecString(mimeType: string): "vp8" | "h264" | "vp9" | "av1";
|
19
|
+
/**
|
20
|
+
* Ratchets a key. See
|
21
|
+
* https://tools.ietf.org/html/draft-omara-sframe-00#section-4.3.5.1
|
22
|
+
*/
|
23
|
+
export declare function ratchet(material: CryptoKey, salt: string): Promise<ArrayBuffer>;
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/e2ee/utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,YAE9B;AAED,wBAAgB,0BAA0B,YAGzC;AAED,wBAAgB,2BAA2B,YAM1C;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,GACjD,KAAK,IAAI,oBAAoB,CAE/B;AAED,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,UAAU,GAAG,WAAW,EAClC,SAAS,GAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAmC,EACrE,KAAK,GAAE,QAAQ,GAAG,SAAqB,sBAUxC;AAED,wBAAsB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,sBAcjE;AA0BD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM;;;GAiBjE;AAED,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,kCAM1D;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAKrF"}
|
@@ -0,0 +1,175 @@
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
2
|
+
import type { VideoCodec } from '../../room/track/options';
|
3
|
+
import { CryptorCallbacks, DecodeRatchetOptions, KeyProviderOptions, KeySet } from '../types';
|
4
|
+
import type { ParticipantKeyHandler } from './ParticipantKeyHandler';
|
5
|
+
export interface FrameCryptorConstructor {
|
6
|
+
new (opts?: unknown): BaseFrameCryptor;
|
7
|
+
}
|
8
|
+
export interface TransformerInfo {
|
9
|
+
readable: ReadableStream;
|
10
|
+
writable: WritableStream;
|
11
|
+
transformer: TransformStream;
|
12
|
+
abortController: AbortController;
|
13
|
+
}
|
14
|
+
export declare class BaseFrameCryptor extends EventEmitter<CryptorCallbacks> {
|
15
|
+
encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
16
|
+
decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* Cryptor is responsible for en-/decrypting media frames.
|
20
|
+
* Each Cryptor instance is responsible for en-/decrypting a single mediaStreamTrack.
|
21
|
+
*/
|
22
|
+
export declare class FrameCryptor extends BaseFrameCryptor {
|
23
|
+
private sendCounts;
|
24
|
+
private isKeyInvalid;
|
25
|
+
private participantId;
|
26
|
+
private trackId;
|
27
|
+
private keys;
|
28
|
+
private videoCodec?;
|
29
|
+
private rtpMap;
|
30
|
+
private keyProviderOptions;
|
31
|
+
/**
|
32
|
+
* used for detecting server injected unencrypted frames
|
33
|
+
*/
|
34
|
+
private unencryptedFrameByteTrailer;
|
35
|
+
constructor(opts: {
|
36
|
+
keys: ParticipantKeyHandler;
|
37
|
+
participantId: string;
|
38
|
+
keyProviderOptions: KeyProviderOptions;
|
39
|
+
unencryptedFrameBytes?: Uint8Array;
|
40
|
+
});
|
41
|
+
/**
|
42
|
+
* Assign a different participant to the cryptor.
|
43
|
+
* useful for transceiver re-use
|
44
|
+
* @param id
|
45
|
+
* @param keys
|
46
|
+
*/
|
47
|
+
setParticipant(id: string, keys: ParticipantKeyHandler): void;
|
48
|
+
unsetParticipant(): void;
|
49
|
+
getParticipantId(): string | undefined;
|
50
|
+
getTrackId(): string | undefined;
|
51
|
+
/**
|
52
|
+
* Update the video codec used by the mediaStreamTrack
|
53
|
+
* @param codec
|
54
|
+
*/
|
55
|
+
setVideoCodec(codec: VideoCodec): void;
|
56
|
+
/**
|
57
|
+
* rtp payload type map used for figuring out codec of payload type when encoding
|
58
|
+
* @param map
|
59
|
+
*/
|
60
|
+
setRtpMap(map: Map<number, VideoCodec>): void;
|
61
|
+
setupTransform(operation: 'encode' | 'decode', readable: ReadableStream, writable: WritableStream, trackId: string, codec?: VideoCodec): void;
|
62
|
+
/**
|
63
|
+
* Function that will be injected in a stream and will encrypt the given encoded frames.
|
64
|
+
*
|
65
|
+
* @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
|
66
|
+
* @param {TransformStreamDefaultController} controller - TransportStreamController.
|
67
|
+
*
|
68
|
+
* The VP8 payload descriptor described in
|
69
|
+
* https://tools.ietf.org/html/rfc7741#section-4.2
|
70
|
+
* is part of the RTP packet and not part of the frame and is not controllable by us.
|
71
|
+
* This is fine as the SFU keeps having access to it for routing.
|
72
|
+
*
|
73
|
+
* The encrypted frame is formed as follows:
|
74
|
+
* 1) Find unencrypted byte length, depending on the codec, frame type and kind.
|
75
|
+
* 2) Form the GCM IV for the frame as described above.
|
76
|
+
* 3) Encrypt the rest of the frame using AES-GCM.
|
77
|
+
* 4) Allocate space for the encrypted frame.
|
78
|
+
* 5) Copy the unencrypted bytes to the start of the encrypted frame.
|
79
|
+
* 6) Append the ciphertext to the encrypted frame.
|
80
|
+
* 7) Append the IV.
|
81
|
+
* 8) Append a single byte for the key identifier.
|
82
|
+
* 9) Enqueue the encrypted frame for sending.
|
83
|
+
*/
|
84
|
+
encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
|
85
|
+
/**
|
86
|
+
* Function that will be injected in a stream and will decrypt the given encoded frames.
|
87
|
+
*
|
88
|
+
* @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
|
89
|
+
* @param {TransformStreamDefaultController} controller - TransportStreamController.
|
90
|
+
*/
|
91
|
+
decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
|
92
|
+
/**
|
93
|
+
* Function that will decrypt the given encoded frame. If the decryption fails, it will
|
94
|
+
* ratchet the key for up to RATCHET_WINDOW_SIZE times.
|
95
|
+
*/
|
96
|
+
decryptFrame(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, keyIndex: number, initialMaterial?: KeySet | undefined, ratchetOpts?: DecodeRatchetOptions): Promise<RTCEncodedVideoFrame | RTCEncodedAudioFrame | undefined>;
|
97
|
+
/**
|
98
|
+
* Construct the IV used for AES-GCM and sent (in plain) with the packet similar to
|
99
|
+
* https://tools.ietf.org/html/rfc7714#section-8.1
|
100
|
+
* It concatenates
|
101
|
+
* - the 32 bit synchronization source (SSRC) given on the encoded frame,
|
102
|
+
* - the 32 bit rtp timestamp given on the encoded frame,
|
103
|
+
* - a send counter that is specific to the SSRC. Starts at a random number.
|
104
|
+
* The send counter is essentially the pictureId but we currently have to implement this ourselves.
|
105
|
+
* There is no XOR with a salt. Note that this IV leaks the SSRC to the receiver but since this is
|
106
|
+
* randomly generated and SFUs may not rewrite this is considered acceptable.
|
107
|
+
* The SSRC is used to allow demultiplexing multiple streams with the same key, as described in
|
108
|
+
* https://tools.ietf.org/html/rfc3711#section-4.1.1
|
109
|
+
* The RTP timestamp is 32 bits and advances by the codec clock rate (90khz for video, 48khz for
|
110
|
+
* opus audio) every second. For video it rolls over roughly every 13 hours.
|
111
|
+
* The send counter will advance at the frame rate (30fps for video, 50fps for 20ms opus audio)
|
112
|
+
* every second. It will take a long time to roll over.
|
113
|
+
*
|
114
|
+
* See also https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams
|
115
|
+
*/
|
116
|
+
private makeIV;
|
117
|
+
getUnencryptedBytes(frame: RTCEncodedVideoFrame | RTCEncodedAudioFrame): number;
|
118
|
+
/**
|
119
|
+
* inspects frame payloadtype if available and maps it to the codec specified in rtpMap
|
120
|
+
*/
|
121
|
+
getVideoCodec(frame: RTCEncodedVideoFrame): VideoCodec | undefined;
|
122
|
+
}
|
123
|
+
/**
|
124
|
+
* Slice the NALUs present in the supplied buffer, assuming it is already byte-aligned
|
125
|
+
* code adapted from https://github.com/medooze/h264-frame-parser/blob/main/lib/NalUnits.ts to return indices only
|
126
|
+
*/
|
127
|
+
export declare function findNALUIndices(stream: Uint8Array): number[];
|
128
|
+
export declare function parseNALUType(startByte: number): NALUType;
|
129
|
+
export declare enum NALUType {
|
130
|
+
/** Coded slice of a non-IDR picture */
|
131
|
+
SLICE_NON_IDR = 1,
|
132
|
+
/** Coded slice data partition A */
|
133
|
+
SLICE_PARTITION_A = 2,
|
134
|
+
/** Coded slice data partition B */
|
135
|
+
SLICE_PARTITION_B = 3,
|
136
|
+
/** Coded slice data partition C */
|
137
|
+
SLICE_PARTITION_C = 4,
|
138
|
+
/** Coded slice of an IDR picture */
|
139
|
+
SLICE_IDR = 5,
|
140
|
+
/** Supplemental enhancement information */
|
141
|
+
SEI = 6,
|
142
|
+
/** Sequence parameter set */
|
143
|
+
SPS = 7,
|
144
|
+
/** Picture parameter set */
|
145
|
+
PPS = 8,
|
146
|
+
/** Access unit delimiter */
|
147
|
+
AUD = 9,
|
148
|
+
/** End of sequence */
|
149
|
+
END_SEQ = 10,
|
150
|
+
/** End of stream */
|
151
|
+
END_STREAM = 11,
|
152
|
+
/** Filler data */
|
153
|
+
FILLER_DATA = 12,
|
154
|
+
/** Sequence parameter set extension */
|
155
|
+
SPS_EXT = 13,
|
156
|
+
/** Prefix NAL unit */
|
157
|
+
PREFIX_NALU = 14,
|
158
|
+
/** Subset sequence parameter set */
|
159
|
+
SUBSET_SPS = 15,
|
160
|
+
/** Depth parameter set */
|
161
|
+
DPS = 16,
|
162
|
+
/** Coded slice of an auxiliary coded picture without partitioning */
|
163
|
+
SLICE_AUX = 19,
|
164
|
+
/** Coded slice extension */
|
165
|
+
SLICE_EXT = 20,
|
166
|
+
/** Coded slice extension for a depth view component or a 3D-AVC texture view component */
|
167
|
+
SLICE_LAYER_EXT = 21
|
168
|
+
}
|
169
|
+
/**
|
170
|
+
* we use a magic frame trailer to detect whether a frame is injected
|
171
|
+
* by the livekit server and thus to be treated as unencrypted
|
172
|
+
* @internal
|
173
|
+
*/
|
174
|
+
export declare function isFrameServerInjected(frameData: ArrayBuffer, trailerBytes: Uint8Array): boolean;
|
175
|
+
//# sourceMappingURL=FrameCryptor.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FrameCryptor.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/FrameCryptor.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EAClB,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,WAAW,uBAAuB;IACtC,KAAK,IAAI,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9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OAAO,KAAK;IACZ,oBAAoB;IACpB,UAAU,KAAK;IACf,kBAAkB;IAClB,WAAW,KAAK;IAChB,uCAAuC;IACvC,OAAO,KAAK;IACZ,sBAAsB;IACtB,WAAW,KAAK;IAChB,oCAAoC;IACpC,UAAU,KAAK;IACf,0BAA0B;IAC1B,GAAG,KAAK;IAIR,qEAAqE;IACrE,SAAS,KAAK;IACd,4BAA4B;IAC5B,SAAS,KAAK;IACd,0FAA0F;IAC1F,eAAe,KAAK;CAGrB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,GAAG,OAAO,CAK/F"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
2
|
+
import type { KeyProviderOptions, KeySet, ParticipantKeyHandlerCallbacks } from '../types';
|
3
|
+
/**
|
4
|
+
* ParticipantKeyHandler is responsible for providing a cryptor instance with the
|
5
|
+
* en-/decryption key of a participant. It assumes that all tracks of a specific participant
|
6
|
+
* are encrypted with the same key.
|
7
|
+
* Additionally it exposes a method to ratchet a key which can be used by the cryptor either automatically
|
8
|
+
* if decryption fails or can be triggered manually on both sender and receiver side.
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
export declare class ParticipantKeyHandler extends EventEmitter<ParticipantKeyHandlerCallbacks> {
|
12
|
+
private currentKeyIndex;
|
13
|
+
private cryptoKeyRing;
|
14
|
+
private enabled;
|
15
|
+
private keyProviderOptions;
|
16
|
+
private ratchetPromiseMap;
|
17
|
+
private participantId;
|
18
|
+
constructor(participantId: string | undefined, isEnabled: boolean, keyProviderOptions: KeyProviderOptions);
|
19
|
+
setEnabled(enabled: boolean): void;
|
20
|
+
/**
|
21
|
+
* Ratchets the current key (or the one at keyIndex if provided) and
|
22
|
+
* returns the ratcheted material
|
23
|
+
* if `setKey` is true (default), it will also set the ratcheted key directly on the crypto key ring
|
24
|
+
* @param keyIndex
|
25
|
+
* @param setKey
|
26
|
+
*/
|
27
|
+
ratchetKey(keyIndex?: number, setKey?: boolean): Promise<CryptoKey>;
|
28
|
+
/**
|
29
|
+
* takes in a key material with `deriveBits` and `deriveKey` set as key usages
|
30
|
+
* and derives encryption keys from the material and sets it on the key ring buffer
|
31
|
+
* together with the material
|
32
|
+
* also updates the currentKeyIndex
|
33
|
+
*/
|
34
|
+
setKeyFromMaterial(material: CryptoKey, keyIndex?: number, emitRatchetEvent?: boolean): Promise<void>;
|
35
|
+
setKeySet(keySet: KeySet, keyIndex: number, emitRatchetEvent?: boolean): Promise<void>;
|
36
|
+
setCurrentKeyIndex(index: number): Promise<void>;
|
37
|
+
isEnabled(): boolean;
|
38
|
+
getCurrentKeyIndex(): number;
|
39
|
+
/**
|
40
|
+
* returns currently used KeySet or the one at `keyIndex` if provided
|
41
|
+
* @param keyIndex
|
42
|
+
* @returns
|
43
|
+
*/
|
44
|
+
getKeySet(keyIndex?: number): KeySet;
|
45
|
+
}
|
46
|
+
//# sourceMappingURL=ParticipantKeyHandler.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ParticipantKeyHandler.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/ParticipantKeyHandler.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAGzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAM3F;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,YAAY,CAAC,8BAA8B,CAAC;IACrF,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,aAAa,CAAgB;IAErC,OAAO,CAAC,OAAO,CAAU;IAEzB,OAAO,CAAC,kBAAkB,CAAqB;IAE/C,OAAO,CAAC,iBAAiB,CAAkC;IAE3D,OAAO,CAAC,aAAa,CAAqB;gBAGxC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,SAAS,EAAE,OAAO,EAClB,kBAAkB,EAAE,kBAAkB;IAWxC,UAAU,CAAC,OAAO,EAAE,OAAO;IAI3B;;;;;;OAMG;IACH,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,CAAC,SAAS,CAAC;IA+BhE;;;;;OAKG;IACG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,SAAI,EAAE,gBAAgB,UAAQ;IAS9E,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,UAAQ;IAOpE,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAItC,SAAS;IAIT,kBAAkB;IAIlB;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM;CAG5B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"e2ee.worker.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/e2ee.worker.ts"],"names":[],"mappings":""}
|
package/dist/src/index.d.ts
CHANGED
@@ -27,9 +27,11 @@ export * from './room/events';
|
|
27
27
|
export * from './room/track/Track';
|
28
28
|
export * from './room/track/create';
|
29
29
|
export * from './room/track/options';
|
30
|
+
export { facingModeFromDeviceLabel, facingModeFromLocalTrack } from './room/track/facingMode';
|
30
31
|
export * from './room/track/types';
|
31
32
|
export type { DataPublishOptions, SimulationScenario } from './room/types';
|
32
33
|
export * from './version';
|
34
|
+
export * from './e2ee';
|
33
35
|
export * from './room/track/processor/types';
|
34
36
|
export { setLogLevel, setLogExtension, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, isBrowserSupported, supportsAdaptiveStream, supportsDynacast, supportsAV1, supportsVP9, createAudioAnalyser, LogLevel, Room, ConnectionState, RoomState, DataPacket_Kind, DisconnectReason, Participant, RemoteParticipant, LocalParticipant, LocalAudioTrack, LocalVideoTrack, LocalTrack, LocalTrackPublication, RemoteTrack, RemoteAudioTrack, RemoteVideoTrack, RemoteTrackPublication, TrackPublication, VideoQuality, ConnectionQuality, DefaultReconnectPolicy, CriticalTimers, };
|
35
37
|
export type { ElementInfo, ParticipantTrackPermission, AudioAnalyserOptions, LiveKitReactNativeInfo, };
|
package/dist/src/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,sBAAsB,MAAM,+BAA+B,CAAC;AACnE,OAAO,IAAI,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AACnE,OAAO,WAAW,EAAE,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,iBAAiB,MAAM,sCAAsC,CAAC;AACrE,OAAO,cAAc,MAAM,eAAe,CAAC;AAC3C,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,sBAAsB,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACZ,MAAM,cAAc,CAAC;AAEtB,cAAc,oCAAoC,CAAC;AACnD,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,cAAc,WAAW,CAAC;AAC1B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,CAAC;AACF,YAAY,EACV,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,EACpB,sBAAsB,GACvB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MA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