Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
Create PFX from PEM (Certificate and Private Key Files)Create a PFX file from a pair of PEM files (the certificate PEM and private key PEM). LOCAL lnSuccess LOCAL loCert LOCAL loPrivkey LOCAL lnBIncludeCertsInChain loCert = CreateObject('Chilkat.Cert') lnSuccess = loCert.LoadFromFile("chilkat_cert.pem") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loCert.LastErrorText) QUIT ENDIF loPrivkey = CreateObject('Chilkat.PrivateKey') * If the private key PEM is encrypted, call LoadEncryptedPemFile instead. lnSuccess = loPrivkey.LoadPemFile("chilkat_pkey.pem") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loPrivkey.LastErrorText) QUIT ENDIF lnSuccess = loCert.SetPrivateKey(loPrivkey) IF (lnSuccess <> 1) THEN =MESSAGEBOX(loCert.LastErrorText) QUIT ENDIF * Now export to a PFX: lnBIncludeCertsInChain = 0 lnSuccess = loCert.ExportToPfxFile("chilkat2.pfx","myPassword",lnBIncludeCertsInChain) IF (lnSuccess <> 1) THEN =MESSAGEBOX(loCert.LastErrorText) QUIT ENDIF =MESSAGEBOX("PFX created!") |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser