I have to extract public key from .pem certificate using cryptography library in Python2 but am able to get only public key object .
In cryptography documentation , I found this code
from cryptography.hazmat.primitives.asymmetric import rsa
pem_cert=open("/home/lab14/aes/fd.pem","rb").read()
cert = x509.load_pem_x509_certificate(pem_cert, default_backend())
public_key = cert.public_key()
print(public_key)
But when run this, I get public key object but not actual key in hex format.
Here is the output I got
<cryptography.hazmat.backends.openssl.rsa._RSAPublicKey object at 0x7f49e214d6d8>
Any assistance would be helpful and appreciated . Thank you