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.
from M2Crypto import RSA
RSA.load_key('mykey.pem').save_pub_key('mykey.pub')