Sample code for 30+ languages & platforms
Perl

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

# Signing certificates can be obtained from many different sources..

# Load from a PFX
my $cryptA = Chilkat2::Crypt2->new;
my $certA = Chilkat2::Cert->new;
my $success = $certA->LoadPfxFile('c:/someDir/pfx_files/a.pfx', 'pfx_file_password');
$success = $cryptA->SetSigningCert($certA);
# ...

# Load from a smart card or USB token.
my $cryptB = Chilkat2::Crypt2->new;
my $certB = Chilkat2::Cert->new;
$certB->SmartCardPin('123456');
$success = $certB->LoadFromSmartcard('');
$success = $cryptB->SetSigningCert($certB);
# ...

# Load from a the Windows certificate store or macOS keychain
my $cryptC = Chilkat2::Crypt2->new;
my $certC = Chilkat2::Cert->new;
$success = $certC->LoadByCommonName('Xyz 123');
$success = $cryptC->SetSigningCert($certC);
# ...