AutoIt
AutoIt
Get Base64 Public Key from Private Key
See more ECC Examples
Demonstrates how to get the public key in base64 format from a private key.Chilkat AutoIt Downloads
Local $bSuccess = False
; Load a private key from base64.
$oBd = ObjCreate("Chilkat.BinData")
$bSuccess = $oBd.AppendEncoded("MHQCA....n0Q==","base64")
$oPrivKey = ObjCreate("Chilkat.PrivateKey")
$bSuccess = $oPrivKey.LoadAnyFormat($oBd,"")
If ($bSuccess = False) Then
ConsoleWrite($oPrivKey.LastErrorText & @CRLF)
Exit
EndIf
$oPubKey = ObjCreate("Chilkat.PublicKey")
$oPrivKey.ToPublicKey($oPubKey)
Local $sPubKeyBase64 = $oPubKey.GetEncoded(True,"base64")
ConsoleWrite($sPubKeyBase64 & @CRLF)