Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3/4 Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(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> <% set bd = Server.CreateObject("Chilkat_9_5_0.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>" set pfx = Server.CreateObject("Chilkat_9_5_0.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-2016 Chilkat Software, Inc. All Rights Reserved.