Zig
Zig
Example: Crypt2.AddPfxSourceFile method
Demonstrates how to call the AddPfxSourceFile method.Chilkat Zig Downloads
const std = @import("std");
const chilkat = @import("chilkat");
pub fn main(init: std.process.Init) !void {
const alloc = init.arena.allocator();
var success: bool = false;
const crypt = try chilkat.Crypt2.init();
defer crypt.deinit();
success = false;
// Do public-key decryption (RSA)
crypt.setCryptAlgorithm("pki");
// ...
// ...
// ...
var pfx_path: [:0]const u8 = "c:/my_pfx_files/a.pfx";
var pfx_password: [:0]const u8 = "secret1";
crypt.addPfxSourceFile(pfx_path, pfx_password) catch {
std.debug.print("{s}\n", .{try crypt.getLastErrorText(alloc)});
return;
};
// Add as many as PFX sources as desired...
pfx_path = "c:/my_pfx_files/b.pfx";
pfx_password = "secret2";
crypt.addPfxSourceFile(pfx_path, pfx_password) catch {
std.debug.print("{s}\n", .{try crypt.getLastErrorText(alloc)});
return;
};
// ...
// ...
}