StreamEncryptionManager
The SDK's default E2EEManager, backed by WebRTC's framed AES-GCM encryption. Frames are encrypted before they leave the device and decrypted after they arrive, so the SFU forwards media it cannot read.
Typical use, matching the JavaScript and iOS SDKs:
StreamEncryptionManager.create(myUserId).onSuccess { e2ee ->
e2ee.setSharedKey(keyIndex = 0, key = myKeyBytes)
call.setE2EEManager(e2ee)
call.join()
}You own the instance you create: keep it for as long as you need to rotate keys, and call dispose when you are done with it. The SDK does not dispose managers it did not create, since the same manager is usually reused across rejoins and often across calls.
Instances are safe to use from any thread. Key changes take effect on the frames encrypted after they are applied.
Properties
Functions
Releases the native manager and wipes its keys. Drops the setEventListener observer first so a listener that captured a ViewModel or Activity is not kept alive by native. Subsequent key operations are ignored; attempting to attach an encryptor or decryptor returns a failure so the SDK cannot treat an unprotected track as configured. Dispose only once you are done with every call that uses it.
Turns on periodic E2EEEventType.PERF_REPORT events carrying per-track crypto timings. Off by default; it costs a timing measurement per frame, so leave it off outside diagnostics.
Drops every key held for userId, at every index, falling back to the shared key for that participant. Shared keys are untouched — use removeSharedKey for those.
Drops the shared key at keyIndex.
Asks for a E2EEEventType.KEY_STATE event describing the keys currently held. Answered asynchronously through the listener registered with setEventListener, so register first.
Observes encryption state changes, most importantly decryption failures. Pass null to stop observing. The listener is invoked on a WebRTC internal thread, so hop to your own dispatcher before touching UI state.
Sets the key used for every participant that has no per-user key, including your own outgoing media. Use this when everyone in the call shares one passphrase-derived key.