EncryptionConfig

Used to configure built-in encryption parameters.

struct EncryptionConfig {
  ENCRYPTION_MODE encryptionMode;
  const char* encryptionKey;
  uint8_t encryptionKdfSalt[32];
  bool datastreamEncryptionEnabled;
  const char* getEncryptionString() const;
};

Properties

encryptionMode
Built-in encryption mode. See ENCRYPTION_MODE. Agora recommends using AES_128_GCM2 or AES_256_GCM2, which support encryption salt for enhanced security.
encryptionKey
Encryption key in string format, with no length limit. Agora recommends using a 32-byte key.
Note: If the encryption key is not set or is set to NULL, built-in encryption cannot be used, and the SDK will return -2.
encryptionKdfSalt
Salt used for encryption, 32 bytes in length.
Note: This parameter takes effect only in AES_128_GCM2 or AES_256_GCM2 encryption modes. In this case, make sure this parameter is not 0.
datastreamEncryptionEnabled
Whether to enable data stream encryption:
  • true: Enable data stream encryption.
  • false: (Default) Disable data stream encryption.