pub struct ZipArchive<R> { /* private fields */ }Expand description
A parsed ZIP archive over a seekable reader.
Implementations§
Source§impl<R: Read + Seek> ZipArchive<R>
impl<R: Read + Seek> ZipArchive<R>
Sourcepub fn new(reader: R) -> Result<Self, ZipCoreError>
pub fn new(reader: R) -> Result<Self, ZipCoreError>
Parse the EOCD and central directory of reader.
Sourcepub fn summary(&self) -> &ArchiveSummary
pub fn summary(&self) -> &ArchiveSummary
Container-level offsets/counts for structural audits.
Sourcepub fn file_names(&self) -> impl Iterator<Item = &str>
pub fn file_names(&self) -> impl Iterator<Item = &str>
Iterate entry names in central-directory order.
Sourcepub fn by_index(&mut self, i: usize) -> Result<ZipFile<'_>, ZipCoreError>
pub fn by_index(&mut self, i: usize) -> Result<ZipFile<'_>, ZipCoreError>
Open the entry at index i for decoding (mirrors zip-rs by_index).
Sourcepub fn by_name(&mut self, name: &str) -> Result<ZipFile<'_>, ZipCoreError>
pub fn by_name(&mut self, name: &str) -> Result<ZipFile<'_>, ZipCoreError>
Open the named entry for decoding (mirrors zip-rs by_name).
Sourcepub fn by_index_decrypt(
&mut self,
i: usize,
password: &[u8],
) -> Result<ZipFile<'_>, ZipCoreError>
pub fn by_index_decrypt( &mut self, i: usize, password: &[u8], ) -> Result<ZipFile<'_>, ZipCoreError>
Open the entry at index i, decrypting it with password (ZipCrypto or
WinZip AES). Errors with WrongPassword if the password fails the check.
Sourcepub fn by_name_decrypt(
&mut self,
name: &str,
password: &[u8],
) -> Result<ZipFile<'_>, ZipCoreError>
pub fn by_name_decrypt( &mut self, name: &str, password: &[u8], ) -> Result<ZipFile<'_>, ZipCoreError>
Open the named entry, decrypting it with password.
Sourcepub fn structural_view(&mut self) -> Result<Vec<EntryLayout>, ZipCoreError>
pub fn structural_view(&mut self) -> Result<Vec<EntryLayout>, ZipCoreError>
Raw structural view for the forensic analyzer: per entry, the header
fields as recorded in BOTH the central directory and the local file
header, plus offsets. This is the seam that lets zip-forensic compare
the two copies (tamper signal) without re-implementing a second parser.