Merge remote-tracking branch 'origin/dev' into cody/netwrok_SDK
# Conflicts: # apps/im_app/lib/features/chat/presentation/chat_db_test_view_model.dart # apps/im_app/lib/features/login/presentation/login_view_model.dart 修复逻辑漏洞,性能优化
This commit is contained in:
@@ -8,7 +8,7 @@ import '../entities/encrypted_message.dart';
|
||||
|
||||
abstract class EncryptionRepository {
|
||||
// ==================== RSA 金鑰管理 ====================
|
||||
|
||||
|
||||
/// 生成 RSA 金鑰對
|
||||
/// [keySize] 金鑰長度 (預設 1024, 可用 2048)
|
||||
Future<RsaKeyPair> generateRsaKeyPair({int keySize = 1024});
|
||||
@@ -84,6 +84,14 @@ abstract class EncryptionRepository {
|
||||
required Map<String, Map<String, dynamic>> chatMap,
|
||||
});
|
||||
|
||||
// ==================== 缓存管理 ====================
|
||||
|
||||
/// 清空派生密钥缓存
|
||||
///
|
||||
/// 在 session key 轮换时调用,确保旧密钥的派生结果不会被复用。
|
||||
/// 不影响已加密的消息,只影响后续加解密操作的密钥派生。
|
||||
void clearDerivedKeyCache();
|
||||
|
||||
// ==================== 配置相關 ====================
|
||||
|
||||
/// 設置 AES_SECRET (用於推送解密)
|
||||
@@ -91,8 +99,5 @@ abstract class EncryptionRepository {
|
||||
|
||||
/// 解密 APNS 推送通知內容
|
||||
/// 使用 release.json 中的 AES_SECRET
|
||||
Future<String?> decryptPushNotification({
|
||||
required String encryptedData,
|
||||
});
|
||||
Future<String?> decryptPushNotification({required String encryptedData});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user