[Cryptography-dev] what to import
Robert Moskowitz
rgm at htt-consult.com
Fri Aug 30 15:18:22 EDT 2024
Unfortunately, I go too much be copying examples.
I am not learning how to find the various components to load,
For example, I want to load an x509 cert:
https://cryptography.io/en/3.4.7/x509/reference.html#loading-certificates
with open(x509cert, "rb") as f:
cert = f.read()
cryptography.x509.load_pem_x509_certificate(cert)
cert.serial_number
ImportError: cannot import name 'load_pem_x509_certificate' from
'cryptography.hazmat.primitives'
(/usr/lib64/python3.11/site-packages/cryptography/hazmat/primitives/__init__.py)
I can't find on the website where I am advised what to load. So far,
shotgunning it as not worked. Nor should I really count on that approach.
So where is there advise for importing what from where?
thanks
More information about the Cryptography-dev
mailing list