title: How to save Openssl Key Object by python?
body: <pre><code>import OpenSSL
  
  key = OpenSSL.crypto.PKey()
  key.generate_key(type=OpenSSL.crypto.TYPE_RSA, bits=2048)
  # I wanna save this key object to a file, then read it to produce private key
  
  priv = key.to_cryptography_key()
  pub  = priv.public_key()
  </code></pre>
  <p>How to do this by python3? I need save this as an object, and when I open it, it can be treat as object.</p>