PowerShell
PowerShell
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 PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$success = $false
# Load a private key from base64.
$bd = New-Object Chilkat.BinData
$success = $bd.AppendEncoded("MHQCA....n0Q==","base64")
$privKey = New-Object Chilkat.PrivateKey
$success = $privKey.LoadAnyFormat($bd,"")
if ($success -eq $false) {
$($privKey.LastErrorText)
exit
}
$pubKey = New-Object Chilkat.PublicKey
$privKey.ToPublicKey($pubKey)
$pubKeyBase64 = $pubKey.GetEncoded($true,"base64")
$($pubKeyBase64)