![]() |
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.SetDecryptCert methodDemonstrates how to call the SetDecryptCert method.
integer li_rc oleobject loo_Cert integer li_Success oleobject loo_Decrypt oleobject loo_Bd 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.LoadPfxFile("c:/pfx_files/my.pfx","password") if li_Success <> 1 then Write-Debug loo_Cert.LastErrorText destroy loo_Cert return end if loo_Decrypt = create oleobject li_rc = loo_Decrypt.ConnectToNewObject("Chilkat.Crypt2") loo_Decrypt.CryptAlgorithm = "pki" li_Success = loo_Decrypt.SetDecryptCert(loo_Cert) if li_Success <> 1 then Write-Debug loo_Decrypt.LastErrorText destroy loo_Cert destroy loo_Decrypt return end if loo_Bd = create oleobject li_rc = loo_Bd.ConnectToNewObject("Chilkat.BinData") li_Success = loo_Bd.LoadFile("c:/someDir/pkcs7_encrypted.dat") li_Success = loo_Decrypt.DecryptBd(loo_Bd) if li_Success <> 1 then Write-Debug loo_Decrypt.LastErrorText destroy loo_Cert destroy loo_Decrypt destroy loo_Bd return end if // bd contains the decrypted content. destroy loo_Cert destroy loo_Decrypt destroy loo_Bd |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.