diff --git a/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java b/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java index 4db621466..c09ac8d37 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/common/conf/TSFileConfig.java @@ -268,9 +268,6 @@ public void setEncryptKey(String encryptKey) { } public void setEncryptKeyFromPath(String encryptKeyPath) { - if (!encryptFlag) { - return; - } this.encryptKey = EncryptUtils.getEncryptKeyFromPath(encryptKeyPath); EncryptUtils.encryptParam = EncryptUtils.getEncryptParameter(); EncryptUtils.normalKeyStr = EncryptUtils.getNormalKeyStr(); diff --git a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java index e6c56688b..00db6b65a 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TsFileMetadata.java @@ -147,7 +147,7 @@ public static TsFileMetadata deserializeFrom(ByteBuffer buffer, DeserializeConfi } IDecryptor decryptor = IDecryptor.getDecryptor( - TSFileDescriptor.getInstance().getConfig().getEncryptType(), + propertiesMap.get("encryptType"), TSFileDescriptor.getInstance().getConfig().getEncryptKey().getBytes()); String str = propertiesMap.get("encryptKey"); fileMetaData.dataEncryptKey = decryptor.decrypt(EncryptUtils.getSecondKeyFromStr(str));