def _get_private_key_obj(private_key, passphrase=None):
 private_key = _text_or_file(private_key)
 private_key = get_pem_entry(private_key, pem_type='RSA PRIVATE KEY')
 rsaprivkey = M2Crypto.RSA.load_key_string(private_key, callback=_passphrase_callback(passphrase))
 evpprivkey = M2Crypto.EVP.PKey()
 evpprivkey.assign_rsa(rsaprivkey)
 return evpprivkey

def _get_private_key_obj ( private_key , passphrase = None ) : private_key = _text_or_file ( private_key ) private_key = get_pem_entry ( private_key , pem_type = 'RSA PRIVATE KEY' ) rsaprivkey = M2Crypto . RSA . load_key_string ( private_key , callback = _passphrase_callback ( passphrase ) ) evpprivkey = M2Crypto . EVP . PKey ( ) evpprivkey . assign_rsa ( rsaprivkey ) return evpprivkey
returns a private key object based on pem text .