![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) Example: Crypt2.SetDecryptCert2 methodDemonstrates how to call the SetDecryptCert2 method. This example loads the certificate and private key from PEM files: PEM Format Certificate file ( -----BEGIN CERTIFICATE----- MIID... (base64-encoded data) -----END CERTIFICATE----- Private key file ( -----BEGIN PRIVATE KEY----- MIIE... (base64-encoded data) -----END PRIVATE KEY-----
Use ChilkatAx-win32.pkg Procedure Test Variant vCert Handle hoCert Boolean iSuccess Variant vPrivKey Handle hoPrivKey Handle hoCrypt 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/certAbc.pem" To iSuccess // Assume success... Get Create (RefClass(cComChilkatPrivateKey)) To hoPrivKey If (Not(IsComObjectCreated(hoPrivKey))) Begin Send CreateComObject of hoPrivKey End Get ComLoadAnyFormatFile Of hoPrivKey "c:/certs_and_keys/certAbc_key.pem" To iSuccess // Assume success... Get Create (RefClass(cComChilkatCrypt2)) To hoCrypt If (Not(IsComObjectCreated(hoCrypt))) Begin Send CreateComObject of hoCrypt End Set ComCryptAlgorithm Of hoCrypt To "pki" // ... // ... Get pvComObject of hoCert to vCert Get pvComObject of hoPrivKey to vPrivKey Get ComSetDecryptCert2 Of hoCrypt vCert vPrivKey To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoCrypt To sTemp1 Showln sTemp1 Procedure_Return End Showln "Success." End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.