Chilkat2-Python
Chilkat2-Python
RSA Import Public Key
See more RSA Examples
Shows how to select/import a public key for RSA encryption or signature verification.Chilkat Chilkat2-Python Downloads
import sys
import chilkat2
success = False
pubKey = chilkat2.PublicKey()
# In all Chilkat methods expecting a path, you pass either absolute or relative paths.
success = pubKey.LoadFromFile("rsaKeys/myTestRsaPublic.pem")
if (success == False):
print(pubKey.LastErrorText)
sys.exit()
rsa = chilkat2.Rsa()
# Tell RSA to use the public key.
rsa.UsePublicKey(pubKey)