enableEncryption abstract method

Future<void> enableEncryption({
  1. required bool enabled,
  2. required EncryptionConfig config,
})

开启或关闭内置加密。

用户离开频道后,SDK 会自动关闭加密。如需重新开启加密,你需要在用户再次加入频道前调用该方法。 同一频道内的所有用户在调用该方法时,必须设置相同的加密模式和密钥。 如果开启了内置加密,则不能使用旁路推流功能。

  • enabled 是否开启内置加密: true : 开启内置加密。 false :(默认)关闭内置加密。
  • config 配置内置加密模式和密钥。详见 EncryptionConfig 。

Returns 方法成功调用时,无返回值;方法调用失败时,会抛出 AgoraRtcException 异常,你需要捕获异常并进行处理。详见错误码了解详情和解决建议。

Implementation

Future<void> enableEncryption(
    {required bool enabled, required EncryptionConfig config});