EncryptionConfig
Built-in encryption configurations.
public class EncryptionConfig { public enum EncryptionMode { AES_128_XTS(1), AES_128_ECB(2), AES_256_XTS(3), SM4_128_ECB(4), AES_128_GCM(5), AES_256_GCM(6), AES_128_GCM2(7), AES_256_GCM2(8), MODE_END(9); private int value; private EncryptionMode(int v) { value = v; } public int getValue() { return this.value; } }
Attributes
- encryptionMode
-
The built-in encryption mode. See EncryptionMode. Agora recommends using
AES_128_GCM2
orAES_256_GCM2
encrypted mode. These two modes support the use of salt for higher security. - encryptionKey
-
Encryption key in string type with unlimited length. Agora recommends using a 32-byte key.
Attention: If you do not set an encryption key or set it asNULL
, you cannot use the built-in encryption, and the SDK returns-2
. - encryptionKdfSalt
-
Salt, 32 bytes in length. Agora recommends that you use OpenSSL to generate salt on the server side. See Media Stream Encryption for details. See "Media Stream Encryption" for details.
Attention: This parameter takes effect only inAES_128_GCM2
orAES_256_GCM2
encrypted mode. In this case, ensure that this parameter is not0
.