title: PKCS#12 support in pyOpenSSL is deprecated
body: <p>I would like to get the expirydate from the cert_name.pfx like in:
  <a href="https://stackoverflow.com/questions/29801744/get-pfx-cert-file-expiration-with-pyopenssl">Get .pfx Cert File Expiration with pyOpenSSL</a></p>
  <pre><code>from OpenSSL import crypto
  from cryptography import x509
  from cryptography.hazmat.backends import default_backend
  
  pkcs12 = crypto.load_pkcs12(open('cert.pfx', &quot;rb&quot;).read(), '1234')
  pem_data = crypto.dump_certificate(crypto.FILETYPE_PEM, pkcs12.get_certificate())
  cert = x509.load_pem_x509_certificate(pem_data, default_backend())
  print(cert.not_valid_after)
  </code></pre>
  <p>I got the following errors:</p>
  <ol>
  <li>DeprecationWarning: PKCS#12 support in pyOpenSSL is deprecated. You should use the APIs in cryptography.</li>
  <li>DeprecationWarning: str for passphrase is no longer accepted, use bytes. Coming from this line:</li>
  </ol>
  <p>The second error disappeared after ....read(), b'1234') I added the 'b'</p>
  <p>If I can use this anymore:
  crypto.load_pkcs12(open('cert.pfx', &quot;rb&quot;).read(), '1234')</p>
  <p>What can I use instead in reading the expiry date of a pkcs12 formatted certificate? (Using python 3.8)</p>