setE2EEManager
Attaches an end-to-end encryption manager, so that media published from and received by this call is encrypted before it reaches Stream's infrastructure.
Must be called before join. The publisher and subscriber capture the manager when they are built, and the join request tells the coordinator whether this call is encrypted — a mismatch there is rejected server side. The manager survives rejoins and migrations, so it only needs to be set once.
Pass StreamEncryptionManager for Stream's default AES-GCM implementation, or your own E2EEManager to keep the SDK out of your encryption entirely:
StreamEncryptionManager.create(myUserId).onSuccess { e2ee ->
e2ee.setSharedKey(keyIndex = 0, key = myKeyBytes)
call.setE2EEManager(e2ee)
call.join()
}Keys stay on the manager, deliberately: keep your reference to it to add, remove and rotate keys, during the call as well as before it. Generating and distributing key material has to stay outside Stream's infrastructure, so the SDK never holds or transports it.
You own the manager's lifecycle too — the SDK does not dispose it, since the same instance is normally reused across rejoins and often across calls.
Note that an encrypted call cannot be recorded, transcribed, closed-captioned, thumbnailed or broadcast over HLS: none of that content is readable by Stream, so the coordinator rejects those requests.
Return
Success when the manager was updated, or a failure if the call has already joined.
Parameters
The manager to use, or null to join unencrypted.