(AutoIt) Transition from Cert.ExportPublicKey to Cert.GetPublicKey
Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey. Note: This example requires Chilkat v11.0.0 or greater.
$oCert = ObjCreate("Chilkat.Cert")
; ------------------------------------------------------------------------
; The ExportPublicKey method is deprecated:
Local $oPublickeyObj = $oCert.ExportPublicKey()
If ($oCert.LastMethodSuccess = False) Then
ConsoleWrite($oCert.LastErrorText & @CRLF)
Exit
EndIf
; ...
; ...
; ------------------------------------------------------------------------
; Do the equivalent using GetPublicKey.
; Your application creates a new, empty PublicKey object which is passed
; in the last argument and filled upon success.
$oPublickeyOut = ObjCreate("Chilkat.PublicKey")
Local $bSuccess = $oCert.GetPublicKey($oPublickeyOut)
If ($bSuccess = False) Then
ConsoleWrite($oCert.LastErrorText & @CRLF)
Exit
EndIf
|