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
(DataFlex) Convert CRL PEM to XMLLoads a CRL (Certificate Revocation List) from the PEM file format and converts to XML to allow for visual examination and parsing. Note: This example requires Chilkat v9.5.0.77 or greater.
Use ChilkatAx-win32.pkg Procedure Test Handle hoPem Boolean iSuccess Integer iNumCrls Integer i Handle hoAsn Handle hoXml String sCrlBase64 String sTemp1 Boolean bTemp1 // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. // This example requires Chilkat v9.5.0.77 or greater. Get Create (RefClass(cComChilkatPem)) To hoPem If (Not(IsComObjectCreated(hoPem))) Begin Send CreateComObject of hoPem End Set ComVerboseLogging Of hoPem To True Get ComLoadPemFile Of hoPem "qa_data/crl/sampleCrl.pem" "password_not_used" To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoPem To sTemp1 Showln sTemp1 Procedure_Return End Get ComNumCrls Of hoPem To iNumCrls Move 0 To i Get Create (RefClass(cComChilkatAsn)) To hoAsn If (Not(IsComObjectCreated(hoAsn))) Begin Send CreateComObject of hoAsn End Get Create (RefClass(cComChilkatXml)) To hoXml If (Not(IsComObjectCreated(hoXml))) Begin Send CreateComObject of hoXml End While (i < iNumCrls) // Get the CRL as base64 (multi-line) Get ComGetEncodedItem Of hoPem "crl" "" "base64_mime" i To sCrlBase64 Get ComLastMethodSuccess Of hoPem To bTemp1 If (bTemp1 <> True) Begin Get ComLastErrorText Of hoPem To sTemp1 Showln sTemp1 Procedure_Return End Showln sCrlBase64 Get ComLoadEncoded Of hoAsn sCrlBase64 "base64" To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoAsn To sTemp1 Showln sTemp1 Procedure_Return End // Convert ASN.1 to XML and load into xml and re-emit for pretty printing.. Get ComAsnToXml Of hoAsn To sTemp1 Get ComLoadXml Of hoXml sTemp1 To iSuccess Get ComGetXml Of hoXml To sTemp1 Showln sTemp1 // Use this online tool to generate parsing code from CRL XML: // Generate Parsing Code from XML Showln "-------------------------------------" Move (i + 1) To i Loop End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.