Sample code for 30+ languages & platforms
Rust

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat Rust Downloads

Rust

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

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

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

let bd_pfx = chilkat::BinData::new();
let _ = bd_pfx.load_file("c:/my_pfx_files/a.pfx").is_ok();
// ...

let mut pfx_password = "secret1".to_string();
if crypt.add_pfx_source_bd(&bd_pfx, &pfx_password).is_err() {
    println!("{}", crypt.last_error_text());
    return;
}

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

// ...
// ...