zipsign_api/unsign/
zip.rs

1#![cfg_attr(docsrs, doc(cfg(feature = "unsign-zip")))]
2
3use std::io::{Read, Seek, Write};
4
5use crate::sign_unsign_zip::{CopyZipError, copy_zip};
6
7crate::Error! {
8    /// An error returned by [`copy_and_unsign_zip()`]
9    pub struct UnsignZipError(Error) {
10        #[error("could not copy ZIP data")]
11        Copy(#[source] CopyZipError),
12    }
13}
14
15/// Copy a signed `.zip` file without the signatures
16pub fn copy_and_unsign_zip<I, O>(input: &mut I, output: &mut O) -> Result<(), UnsignZipError>
17where
18    I: ?Sized + Read + Seek,
19    O: ?Sized + Read + Seek + Write,
20{
21    copy_zip(input, output).map_err(Error::Copy)?;
22    Ok(())
23}