Rust Requires Chilkat v11.0.0+
Rust
Example: Crypt2.LastSignerCert method
Demonstrates how to call the LastSignerCert method.Chilkat Rust Downloads
let crypt = chilkat::Crypt2::new();
let p7m_path = "qa_data/p7m/Firma.docx.p7m".to_string();
let out_path = "qa_output/Firma.docx".to_string();
if crypt.verify_p7_m(&p7m_path, &out_path).is_err() {
println!("{}", crypt.last_error_text());
return;
}
// Examine the certificate(s) used for signing.
let num_signers = crypt.num_signer_certs();
let mut i = 0;
let cert = chilkat::Cert::new();
while i < num_signers {
let _ = crypt.last_signer_cert(i, &cert);
println!("Signer: {}", cert.subject_dn());
i = i + 1;
}