HarmonyOS 压缩(.zip)文件进行加密问题,AES|CBC?

如何对压缩文件进行加密,是否有对标 Java的CipherOutputStream,通过文件流的形式进行加密,目前看文档https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/crypto-aes-sym-encrypt-decrypt-cbc-V5 没看到对应的介绍。

java代码:

FileInputStream fis = new FileInputStream(zipFilePath);
FileOutputStream fos = new FileOutputStream(targetZipFilePath);
CipherOutputStream cos = new CipherOutputStream(fos, getCipher());

byte[] buffer = new byte[1024];
int length;
while ((length = fis.read(buffer)) > 0) {
  cos.write(buffer, 0, length);
}

fis.close();
cos.close();
fos.close();
阅读 397
1 个回答
logo
HarmonyOS
子站问答
访问
宣传栏