EncryptionConfig
- Flutter
更新时间
配置内置加密模式和密钥。
@JsonSerializable(explicitToJson: true, includeIfNull: false)
class EncryptionConfig {
const EncryptionConfig(
{this.encryptionMode,
this.encryptionKey,
this.encryptionKdfSalt,
this.datastreamEncryptionEnabled});
@JsonKey(name: 'encryptionMode')
final EncryptionMode? encryptionMode;
@JsonKey(name: 'encryptionKey')
final String? encryptionKey;
@JsonKey(name: 'encryptionKdfSalt', ignore: true)
final Uint8List? encryptionKdfSalt;
@JsonKey(name: 'datastreamEncryptionEnabled')
final bool? datastreamEncryptionEnabled;
factory EncryptionConfig.fromJson(Map<String, dynamic> json) =>
_$EncryptionConfigFromJson(json);
Map<String, dynamic> toJson() => _$EncryptionConfigToJson(this);
}属性
| 参数名 | 描述 |
|---|---|
encryptionMode | 内置加密模式。详见 EncryptionMode。建议使用 |
encryptionKey | 内置加密密钥,字符串类型,长度无限制。建议使用 32 字节的密钥。 注: 如果未指定该参数或将该参数设置为 |
encryptionKdfSalt | 盐,长度为 32 字节。建议你在服务端使用 OpenSSL 生成盐。 注: 只有在 |
datastreamEncryptionEnabled | 是否开启数据流加密:
|