Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(VBScript) Load PFX/P12 from a Base64 Encoded PFX FileDemonstrates how to call LoadPfxEncoded.
Dim fso, outFile Set fso = CreateObject("Scripting.FileSystemObject") 'Create a Unicode (utf-16) output text file. Set outFile = fso.CreateTextFile("output.txt", True, True) ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.BinData") set bd = CreateObject("Chilkat.BinData") success = bd.LoadFile("qa_data/pfx/cert_test123.pfx") If (success <> 1) Then outFile.WriteLine("Failed to load PFX file.") WScript.Quit End If ' Get the bytes contained in the PFX in base64 format: strBase64 = bd.GetEncoded("base64") ' The base64 looks like this: "MIIbEAIBAzCCGswGCSqGSIb3DQEHAaCCGr0Eghq5MIIatTCCBg..." outFile.WriteLine(strBase64) ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Pfx") set pfx = CreateObject("Chilkat.Pfx") ' Load the PFX from the base64 string password = "test123" success = pfx.LoadPfxEncoded(strBase64,"base64",password) If (success <> 1) Then outFile.WriteLine(pfx.LastErrorText) WScript.Quit End If outFile.WriteLine("success") outFile.Close |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.