Get public key from private key using python OpenSSL

Well, I create a private key with pyOpenSSL as follows:

from OpenSSL import crypto k = crypto.PKey() k.generate_key(crypto.TYPE_RSA, 2048) print crypto.dump_privatekey(crypto.FILETYPE_PEM, k) 

How to get a public key string from it? I still have not found which method of this library does this. Thanks

+4
source share
1 answer

If

 cert = crypto.dump_certificate(crypto.FILETYPE_PEM, k) 

doesn't do what you want, then it doesn't look like pyOpenSSL supports public key reset. There is no branch connected here that adds this functionality, but I cannot claim that it does what the goal is.

+3
source

All Articles