Closed ygqs250 closed 9 months ago
Hi!
Thanks for the suggestion!
I've just pushed a commit (https://github.com/rikyoz/bit7z/commit/d19423420df7ab6da8bbf2b83076a25b224bafb9) that adds two static functions to the BitArchiveReader
class:
template< typename T >
auto BitArchiveReader::isHeaderEncrypted( const Bit7zLibrary& lib,
T&& in_archive,
const BitInFormat& format ) -> bool;
template< typename T >
auto BitArchiveReader::isEncrypted( const Bit7zLibrary& lib,
T&& in_archive,
const BitInFormat& format ) -> bool;
They're template functions so that they can accept either a file path (string), a buffer, or a standard stream of the archive to be checked.
BitArchiveReader::isHeaderEncrypted
checks whether the archive is fully encrypted (header included), and hence it needs a password to be opened.
BitArchiveReader::isEncrypted
checks whether the archive contains only encrypted files, but can be opened without a password (plain headers).
These functions will be included in the stable version of bit7z v4.
Feature description
Adding a function to determine whether the metadata is encrypted? Now bit7z can only use exceptions to determine whether the metadata is encrypted.
Additional context
No response
Code of Conduct