title: get public key from private key with python OpenSSL
body: <p>Well, I generate a private key with pyOpenSSL as follows:</p>
  
  <pre><code>from OpenSSL import crypto
  k = crypto.PKey()
  k.generate_key(crypto.TYPE_RSA, 2048)
  print crypto.dump_privatekey(crypto.FILETYPE_PEM, k)
  </code></pre>
  
  <p>How do I get the public key string from it? I've still not found what method of this library does it. Thanks</p>