Perl Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Perl Examples

Quick Start
Perl Unicode
Perl Byte Array
Perl Certs
Perl Email
Perl Encryption
Perl FTP
HTML-to-XML
Perl HTTP
Perl IMAP
Perl MHT
Perl MIME
Perl RSA
Perl S/MIME
Perl Signatures
Perl Socket
Perl Spider
Perl Tar
Perl Upload
Perl XML
Perl XMP
Perl Zip

More Examples...
String
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

Import PFX to Certificate Store w/ Key Pairs to Protected Store

Chilkat Module for Perl 5.8.*

Chilkat Module for Perl 5.10.*

Perl script to import a .pfx file (.p12, PKCS12).

# file: importPfx.pl

use chilkat;

# Perl script to import a PFX (PKCS12) digital certificate with private key
# onto a Windows computer.
$pfx = new chilkat::CkPfx();
$pfx->UnlockComponent("anything for 30-day trial");

# If bMachineKeyset = true, the private key is save to the machine-wide protected
# store. Otherwise it is saved to the current logged-on user's protected store
# (and thus only available to the user account that did the import).
$bMachineKeyset = false;
# Set bLocalMachineCertStore = true to import the certificate to the local machine
# registry store, otherwise import to the current user registry store.
$bLocalMachineCertStore = false;
# Set bExportable = true to allow the private key to be re-exported.
$bExportable = true;
# Set bUseWarningDialog = true to turn on high security which causes the Windows
# operating system to issue a warning dialog whenever the private key is accessed.
# Programs running in ASP.NET or a Windows Service will hang if bUseWarningDialog = true
$bUseWarningDialog = false;

$success = $pfx->ImportPfxFile("tagtooga.pfx","secret",
    $bMachineKeyset, $bLocalMachineCertStore, $bExportable, $bUseWarningDialog);
    
if (!$success)
{
	print "Failed to import PFX\n";
	$pfx->SaveLastError("lastError.txt");
}
else
{
	print "Imported PFX!\n";
}






 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2007 Chilkat Software, Inc. All Rights Reserved.