Sample code for 30+ languages & platforms
Rust

Example: Crypt2.AddPfxSourceFile method

Demonstrates how to call the AddPfxSourceFile method.

Chilkat Rust Downloads

Rust

let crypt = chilkat::Crypt2::new();
let _ = false;

// Do public-key decryption (RSA)
crypt.set_crypt_algorithm("pki");

// ...
// ...
// ...

let mut pfx_path = "c:/my_pfx_files/a.pfx".to_string();
let mut pfx_password = "secret1".to_string();
if crypt.add_pfx_source_file(&pfx_path, &pfx_password).is_err() {
    println!("{}", crypt.last_error_text());
    return;
}

// Add as many as PFX sources as desired...
pfx_path = "c:/my_pfx_files/b.pfx".to_string();
pfx_password = "secret2".to_string();
if crypt.add_pfx_source_file(&pfx_path, &pfx_password).is_err() {
    println!("{}", crypt.last_error_text());
    return;
}

// ...
// ...