Skip to content

Instantly share code, notes, and snippets.

@jvehent
Created April 30, 2016 15:10
Show Gist options
  • Save jvehent/d60cde341f9ebb66843e452200c148be to your computer and use it in GitHub Desktop.
Save jvehent/d60cde341f9ebb66843e452200c148be to your computer and use it in GitHub Desktop.
>>> from cryptography import x509
>>> from cryptography.hazmat.backends import default_backend
>>> from cryptography.hazmat.primitives import hashes
>>> cert_pem = open( '/tmp/testcert.crt', 'rb' ).read()
>>> cert = x509.load_pem_x509_certificate(cert_pem, default_backend())
>>> print(cert.public_key())
<cryptography.hazmat.backends.openssl.ec._EllipticCurvePublicKey object at 0x7fe27d803450>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment