(Chilkat2-Python) 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.
import sys
import chilkat2
cert = chilkat2.Cert()
# ------------------------------------------------------------------------
# The ExportPublicKey method is deprecated:
# publickeyObj is a CkPublicKey
publickeyObj = cert.ExportPublicKey()
if (cert.LastMethodSuccess == False):
print(cert.LastErrorText)
sys.exit()
# ...
# ...
# ------------------------------------------------------------------------
# Do the equivalent using GetPublicKey.
# Your application creates a new, empty PublicKey object which is passed
# in the last argument and filled upon success.
publickeyOut = chilkat2.PublicKey()
success = cert.GetPublicKey(publickeyOut)
if (success == False):
print(cert.LastErrorText)
sys.exit()
|