Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Visual FoxPro) Load PFX/P12 from a Base64 Encoded PFX FileDemonstrates how to call LoadPfxEncoded.
LOCAL loBd LOCAL lnSuccess LOCAL lcStrBase64 LOCAL loPfx LOCAL lcPassword * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.BinData') loBd = CreateObject('Chilkat.BinData') lnSuccess = loBd.LoadFile("qa_data/pfx/cert_test123.pfx") IF (lnSuccess <> 1) THEN ? "Failed to load PFX file." RELEASE loBd CANCEL ENDIF * Get the bytes contained in the PFX in base64 format: lcStrBase64 = loBd.GetEncoded("base64") * The base64 looks like this: "MIIbEAIBAzCCGswGCSqGSIb3DQEHAaCCGr0Eghq5MIIatTCCBg..." ? lcStrBase64 * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Pfx') loPfx = CreateObject('Chilkat.Pfx') * Load the PFX from the base64 string lcPassword = "test123" lnSuccess = loPfx.LoadPfxEncoded(lcStrBase64,"base64",lcPassword) IF (lnSuccess <> 1) THEN ? loPfx.LastErrorText RELEASE loBd RELEASE loPfx CANCEL ENDIF ? "success" RELEASE loBd RELEASE loPfx |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.