is it possible to extract public key from private key in pem format in python, with something like M2Crypto? I want to same thing happen like when you use this command:
openssl rsa -in mykey.pem -pubout > mykey.pub
M2Crypto.RSA has load_key function which returns an RSA object which has save_pub_key method.
M2Crypto.RSA
load_key
RSA
save_pub_key
from M2Crypto import RSA RSA.load_key('mykey.pem').save_pub_key('mykey.pub')
M2Crypto.RSAhasload_keyfunction which returns anRSAobject which hassave_pub_keymethod.