pithos_lib 0.8.0

Library and components for encrypting / compressing pithos (.pith) files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Open an archive with a recipient key and list its entries.

use pithos_lib::archive::{AccessKeys, Archive, OpenOptions};
use pithos_lib::crypto::PrivateKey;
use pithos_lib::source::FileSource;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let reader = PrivateKey::from_private_pem_bytes(&std::fs::read("reader.pem")?)?;
    let archive = Archive::open(
        FileSource::open("report.pith")?,
        OpenOptions::default().with_access_keys(AccessKeys::new().with_key(reader)),
    )?;

    for entry in archive.entries() {
        println!("{}: {:?}", entry.path, entry.kind);
    }
    Ok(())
}