hynek / pem

PEM file parsing in Python.
https://pem.readthedocs.io/
MIT License
156 stars 37 forks source link

Split sifting logic into separate function #20

Closed mithrandi closed 1 year ago

mithrandi commented 8 years ago

certificateOptionsFromPEMs actually does two things at the moment:

  1. Sifts a pile of PEM objects into key + cert + chain certs (and with #18, dhparams).
  2. Turns those things into a CertificateOptions.

I'd kinda like to have 1 without 2, since CertificateOptions has OpenSSL.crypto.x509 objects instead of cryptography.x509 objects, the latter having a much more useful API. @hynek do you think it's sensible to split these up?

hynek commented 8 years ago

Yes, because pyOpenSSL will hopefully move to cryptography.x509 too https://github.com/pyca/pyopenssl/pull/439 .

I’m also idling thinking about supporting stdlib by writing those files into temporary files and load them from there.

mithrandi commented 8 years ago

Gah. This can't work exactly as stated, because there's no way to know which cert goes with the private key until you've loaded them with something that can give you the public key...