Replies: 1 comment
-
Hi!
Unfortunately, 7-zip doesn't provide a direct way to check if the password is correct (as far as I know, at least). The main problem I see with a method that verifies a password's validity is that, in the most general case possible, an archive may contain several files encrypted with different passwords or files that are encrypted and others that are not. So this method would not differ much from the current test() method. A test function that tests only a specific file inside the archive might speed up your use case, though. But it will leave to the user to know which file to test.
Yeah, I'll definitely work on improving the exception messages before releasing the stable v4. Anyway, thank you for the suggestions! 🙏 |
Beta Was this translation helpful? Give feedback.
-
I see that the test() method apparently validates that the password is correct, which is great, but for a large archive file it takes a while for test() to complete. I would like the ability to quickly test whether the password the user supplied is valid. I know I can do this by trying to extract a single file but that is clunky.
BTW, when test() throws an exception due to a bad password the exception message is "Unknown Error: Unspecified error". Perhaps a more descriptive message could be used?
Beta Was this translation helpful? Give feedback.
All reactions