CkPython
CkPython
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 CkPython Downloads
import sys
import chilkat
success = False
# Load a private key from base64.
bd = chilkat.CkBinData()
success = bd.AppendEncoded("MHQCA....n0Q==","base64")
privKey = chilkat.CkPrivateKey()
success = privKey.LoadAnyFormat(bd,"")
if (success == False):
print(privKey.lastErrorText())
sys.exit()
pubKey = chilkat.CkPublicKey()
privKey.ToPublicKey(pubKey)
pubKeyBase64 = pubKey.getEncoded(True,"base64")
print(pubKeyBase64)