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) Extract PKCS7 from MIME and DecryptExtracts the base64-encoded PKCS7 body of a MIME message to a file, and then decrypts using Chilkat Crypt2.
Use ChilkatAx-win32.pkg Procedure Test Handle hoMime Boolean iSuccess Handle hoCrypt String sInPath String sOutPath String sTemp1 // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatMime)) To hoMime If (Not(IsComObjectCreated(hoMime))) Begin Send CreateComObject of hoMime End Get ComLoadMimeFile Of hoMime "c:/aaworkarea/EmailInBytes.txt" To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoMime To sTemp1 Showln sTemp1 Procedure_Return End Get ComSaveBody Of hoMime "c:/aaworkarea/smime.p7m" To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoMime To sTemp1 Showln sTemp1 Procedure_Return End Get Create (RefClass(cComChilkatCrypt2)) To hoCrypt If (Not(IsComObjectCreated(hoCrypt))) Begin Send CreateComObject of hoCrypt End Get ComAddPfxSourceFile Of hoCrypt "c:/aaworkarea/my.pfx" "pfxPassword" To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoCrypt To sTemp1 Showln sTemp1 Procedure_Return End // Indicate the public-key (PKCS7) encryption/decryption should be used: Set ComCryptAlgorithm Of hoCrypt To "pki" Move "c:/aaworkarea/smime.p7m" To sInPath Move "c:/aaworkarea/decrypted.dat" To sOutPath Get ComCkDecryptFile Of hoCrypt sInPath sOutPath To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoCrypt To sTemp1 Showln sTemp1 Procedure_Return End Showln "Success." End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.