AutoIt
AutoIt
Example: Crypt2.SetDecryptCert method
Demonstrates how to call the SetDecryptCert method.Chilkat AutoIt Downloads
Local $bSuccess = False
$oCert = ObjCreate("Chilkat.Cert")
$bSuccess = $oCert.LoadPfxFile("c:/pfx_files/my.pfx","password")
If ($bSuccess <> True) Then
ConsoleWrite($oCert.LastErrorText & @CRLF)
Exit
EndIf
$oDecrypt = ObjCreate("Chilkat.Crypt2")
$oDecrypt.CryptAlgorithm = "pki"
$bSuccess = $oDecrypt.SetDecryptCert($oCert)
If ($bSuccess <> True) Then
ConsoleWrite($oDecrypt.LastErrorText & @CRLF)
Exit
EndIf
$oBd = ObjCreate("Chilkat.BinData")
$bSuccess = $oBd.LoadFile("c:/someDir/pkcs7_encrypted.dat")
$bSuccess = $oDecrypt.DecryptBd($oBd)
If ($bSuccess <> True) Then
ConsoleWrite($oDecrypt.LastErrorText & @CRLF)
Exit
EndIf
; bd contains the decrypted content.