![]() |
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
(PowerBuilder) 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-----
integer li_rc oleobject loo_Cert integer li_Success oleobject loo_PrivKey oleobject loo_Crypt loo_Cert = create oleobject li_rc = loo_Cert.ConnectToNewObject("Chilkat.Cert") if li_rc < 0 then destroy loo_Cert MessageBox("Error","Connecting to COM object failed") return end if li_Success = loo_Cert.LoadFromFile("c:/certs_and_keys/certAbc.pem") // Assume success... loo_PrivKey = create oleobject li_rc = loo_PrivKey.ConnectToNewObject("Chilkat.PrivateKey") li_Success = loo_PrivKey.LoadAnyFormatFile("c:/certs_and_keys/certAbc_key.pem") // Assume success... loo_Crypt = create oleobject li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2") loo_Crypt.CryptAlgorithm = "pki" // ... // ... li_Success = loo_Crypt.SetDecryptCert2(loo_Cert,loo_PrivKey) if li_Success = 0 then Write-Debug loo_Crypt.LastErrorText destroy loo_Cert destroy loo_PrivKey destroy loo_Crypt return end if Write-Debug "Success." destroy loo_Cert destroy loo_PrivKey destroy loo_Crypt |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.