setEncryptionMode abstract method

Future<void> setEncryptionMode(
  1. String encryptionMode
)

Sets the built-in encryption mode.

Deprecated: Use enableEncryption instead. The SDK supports built-in encryption schemes, AES-128-GCM is supported by default. Call this method to use other encryption modes. All users in the same channel must use the same encryption mode and secret. Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. Before calling this method, please call setEncryptionSecret to enable the built-in encryption function.

  • encryptionMode The following encryption modes: " aes-128-xts ": 128-bit AES encryption, XTS mode. " aes-128-ecb ": 128-bit AES encryption, ECB mode. " aes-256-xts ": 256-bit AES encryption, XTS mode. " sm4-128-ecb ": 128-bit SM4 encryption, ECB mode. " aes-128-gcm ": 128-bit AES encryption, GCM mode. " aes-256-gcm ": 256-bit AES encryption, GCM mode. "": When this parameter is set as null, the encryption mode is set as " aes-128-gcm " by default.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> setEncryptionMode(String encryptionMode);