Python Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



Python Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
Socket / SSL
SFTP
SMTP
Spider
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Email Object
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

 

Import PFX (.p12, PKCS12) onto Windows system.

Python script to import a .pfx digital certificate with public/private keypair into a Windows registry certificate store, with the public/private key pair installed in a protected store.

Download Python Programming Example Scripts

# file: importPfx.py

import chilkat

# Import a PFX (PKCS12) digital certificate with private key
# onto a Windows computer.
pfx = 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 not 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-2008 Chilkat Software, Inc. All Rights Reserved.