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 Aes128Gcm2 or Aes256Gcm2 encryption modes. These modes support salt and offer higher 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 set to null, built-in encryption cannot be enabled and the SDK returns error code -2.
encryptionKdfSalt
Salt with a length of 32 bytes. It is recommended to generate the salt on the server using OpenSSL.
Note: This parameter is effective only in Aes128Gcm2 or Aes256Gcm2 encryption modes. In this case, ensure the value of this parameter is not all 0.
datastreamEncryptionEnabled
Whether to enable data stream encryption:
  • true: Enable data stream encryption.
  • false: (Default) Disable data stream encryption.