CaliDog/Axeman

Converting as_der to OpenSSL.crypto.X509 object

Closed this issue · 2 comments

Hi Mate

Love your work.

You have the conversion below. How would you reverse this to get a OpenSSL.crypto.X509 object?

"as_der": base64.b64encode(crypto.dump_certificate(crypto.FILETYPE_ASN1, certificate)).decode('utf-8')

Andrei

Hey @ahaw021 - you're looking for the crypto.load_certificate function, you can find more details on the PyOpenSSL package documentation - https://pyopenssl.org/en/stable/api/crypto.html#OpenSSL.crypto.load_certificate

hey @Fitblip

Sorry I was having a silly evening and wasn't thinking properly.

You are right the as_der records can be loaded into PyOpenSSL package.

Thanks for clarifying

Andrei