AgoraEncryptionConfig Class Reference

Inherits from NSObject
Declared in AgoraObjects.h


Configurations of built-in encryption schemas.


Encryption mode. The default encryption mode is AgoraEncryptionModeAES128GCM2. See AgoraEncryptionMode.

@property (assign, nonatomic) AgoraEncryptionMode encryptionMode

Declared In



Encryption key in string type with unlimited length. Agora recommends using a 32-byte key.

@property (copy, nonatomic) NSString *encryptionKey



If you do not set an encryption key or set it as nil, you cannot use the built-in encryption, and the SDK returns -2 (AgoraErrorCodeInvalidArgument).

Declared In



The salt with the length of 32 bytes. Agora recommends using OpenSSL to generate the salt on your server. For details, see Media Stream Encryption.

Note: This parameter is only valid when you set the encryption mode as AgoraEncryptionModeAES128GCM2 or AgoraEncryptionModeAES256GCM2. In this case, ensure that this parameter is not nil or 0, and the data length is 32 bytes.

@property (strong, nonatomic) NSData *encryptionKdfSalt

Declared In