EncryptionConfig
Configures the built-in encryption mode and key.
export class EncryptionConfig {
encryptionMode?: EncryptionMode;
encryptionKey?: string;
encryptionKdfSalt?: number[];
datastreamEncryptionEnabled?: boolean;
}
Properties
- encryptionMode
- Built-in encryption mode. See EncryptionMode. It is recommended to use the
Aes128Gcm2orAes256Gcm2encryption modes. These modes support salt and offer better security. - encryptionKey
- Built-in encryption key, of type string, with no length limit. A 32-byte key is recommended.
Note: If this parameter is not specified or is set to null, built-in encryption cannot be enabled, and the SDK returns error code
-2. - encryptionKdfSalt
- Salt, 32 bytes in length. It is recommended to generate the salt on the server side using OpenSSL.
Note: This parameter takes effect only when the encryption mode is
Aes128Gcm2orAes256Gcm2. In this case, make sure the value of this parameter is not all0. - datastreamEncryptionEnabled
- Whether to enable data stream encryption:
- true: Enable data stream encryption.
- false: (default) Disable data stream encryption.