Skip to main content

02_identity_pkcs12/
02_identity_pkcs12.rs

1#[path = "support/mod.rs"]
2mod support;
3
4use security::Identity;
5
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    let identity =
8        Identity::import_pkcs12_first(&support::fixture("test-identity.p12"), "password")?;
9    let certificate = identity.certificate()?;
10    println!(
11        "label={:?} chain_count={} subject={:?}",
12        identity.label()?,
13        identity.chain_count(),
14        certificate.subject_summary()?
15    );
16    Ok(())
17}