I don’t understand why I should pass the password each time even if I already specified one in the SevenZipArchive instantiation. In addition, other formats such as zip, do not need to pass the password each time to each entry.
It seems that you are encountering an issue where the password provided during the instantiation of the SevenZipArchive is not being recognized when you attempt to open individual entries. This behavior can be confusing, especially since other archive formats like ZIP do not require the password to be passed for each entry.
In the case of SevenZipArchive, it appears that the design requires you to specify the password each time you open an entry. This is likely due to the way the library handles password management for different entries within the archive. While you have set the password during the creation of the SevenZipArchive, the library may not retain this password for subsequent operations on individual entries.
To resolve this, you will need to continue passing the password when calling the open() method on each SevenZipArchiveEntry, as you have done in your example:
This ensures that the correct password is used for each entry, which is necessary for decryption.
If you find this behavior to be a limitation or a bug, it may be worth reporting it to the Aspose support team for further investigation. They may be able to provide additional insights or consider this for future updates.
If you have any further questions or need additional assistance, feel free to ask!
Hello @mrossi, your observation is correct. It is confusing behavior, and we’ll change it. It happens because filenames of 7z archive (i. e. headers) can also be encrypted, and their password could be different.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.