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) Load Certificate from .cer and Private Key from .pemSee more Certificates ExamplesLoad a certificate from a .cer and its associated private key from a .pem.
Use ChilkatAx-win32.pkg Procedure Test Handle hoCert Boolean iSuccess Handle hoSbPem String sTemp1 Get Create (RefClass(cComChilkatCert)) To hoCert If (Not(IsComObjectCreated(hoCert))) Begin Send CreateComObject of hoCert End Get ComLoadFromFile Of hoCert "C:/certs_and_keys/Certificate.cer" To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoCert To sTemp1 Showln sTemp1 Procedure_Return End Get Create (RefClass(cComChilkatStringBuilder)) To hoSbPem If (Not(IsComObjectCreated(hoSbPem))) Begin Send CreateComObject of hoSbPem End Get ComLoadFile Of hoSbPem "C:/certs_and_keys/PrivateKey.pem" "utf-8" To iSuccess If (iSuccess = False) Begin Showln "Failed to load private key PEM" Procedure_Return End Get ComGetAsString Of hoSbPem To sTemp1 Get ComSetPrivateKeyPem Of hoCert sTemp1 To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoCert To sTemp1 Showln sTemp1 Procedure_Return End Showln "The certificate and associated private key are now loaded and ready for signing." End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.