在Objective-C / iPhone中检查zip文件是否受密码保护?

时间:2022-11-26 11:52:12

I'm using lib ZipArchive to unzip file on iPhone, it works pretty well, however I met a issue about checking if a zip file is protected by password.

我正在使用lib ZipArchive在iPhone上解压缩文件,它工作得很好,但是我遇到了一个关于检查zip文件是否受密码保护的问题。

I'm wondering if there's a function to check whether a zip file is protected by password before unzipping, but I didn't get lucky to find an api for that. So does anyone who know how to check it in Objective-C/iPhone or any API in ZipArchive I can use.

我想知道在解压缩之前是否有一个函数可以检查zip文件是否受密码保护,但我没有幸运找到api。任何知道如何在Objective-C / iPhone或ZipArchive中的任何API中查看它的人都可以使用。

Any help would be greatly appreciated.

任何帮助将不胜感激。

1 个解决方案

#1


0  

You can check central directory in archive, and see if encryption bit is set there. However, you will need to read some documentation regarding zip file format.

您可以检查存档中的中心目录,并查看是否在那里设置了加密位。但是,您需要阅读有关zip文件格式的一些文档。

#1


0  

You can check central directory in archive, and see if encryption bit is set there. However, you will need to read some documentation regarding zip file format.

您可以检查存档中的中心目录,并查看是否在那里设置了加密位。但是,您需要阅读有关zip文件格式的一些文档。