Sample code for 30+ languages & platforms
AutoIt Requires Chilkat v11.0.0+

Transition from Cert.ExportPrivateKey to Cert.GetPrivateKey

Provides instructions for replacing deprecated ExportPrivateKey method calls with GetPrivateKey.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

$oCert = ObjCreate("Chilkat.Cert")

;  ------------------------------------------------------------------------
;  The ExportPrivateKey method is deprecated:

Local $oPrivatekeyObj = $oCert.ExportPrivateKey()
If ($oCert.LastMethodSuccess = False) Then
    ConsoleWrite($oCert.LastErrorText & @CRLF)
    Exit
EndIf

;  ...
;  ...

;  ------------------------------------------------------------------------
;  Do the equivalent using GetPrivateKey.
;  Your application creates a new, empty PrivateKey object which is passed 
;  in the last argument and filled upon success.

$oPrivatekeyOut = ObjCreate("Chilkat.PrivateKey")
$bSuccess = $oCert.GetPrivateKey($oPrivatekeyOut)
If ($bSuccess = False) Then
    ConsoleWrite($oCert.LastErrorText & @CRLF)
    Exit
EndIf