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
(Classic ASP) Load PFX/P12 from a Base64 Encoded PFX FileDemonstrates how to call LoadPfxEncoded.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.BinData") set bd = Server.CreateObject("Chilkat.BinData") success = bd.LoadFile("qa_data/pfx/cert_test123.pfx") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode( "Failed to load PFX file.") & "</pre>" Response.End End If ' Get the bytes contained in the PFX in base64 format: strBase64 = bd.GetEncoded("base64") ' The base64 looks like this: "MIIbEAIBAzCCGswGCSqGSIb3DQEHAaCCGr0Eghq5MIIatTCCBg..." Response.Write "<pre>" & Server.HTMLEncode( strBase64) & "</pre>" ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Pfx") set pfx = Server.CreateObject("Chilkat.Pfx") ' Load the PFX from the base64 string password = "test123" success = pfx.LoadPfxEncoded(strBase64,"base64",password) If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode( pfx.LastErrorText) & "</pre>" Response.End End If Response.Write "<pre>" & Server.HTMLEncode( "success") & "</pre>" %> </body> </html> |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.