How to convert a PyOpenSSL object to a PEM encoded string?

I am trying to extract the private key and certificate from a PKCS12 file using pyOpenSSL, and it is difficult for me to determine how to convert the data to strings encoded in PEM. The next question implies that this is possible, but I could not figure it out.

Python: reading pkcs12 certificate with pyOpenSSL.crypto

+1
source share
1 answer

Look at the methods dump_certificate, dump_certificate_request, dump_privatekey: http://pyopenssl.sourceforge.net/pyOpenSSL.html/openssl-crypto.html

+2
source

Source: https://habr.com/ru/post/1402569/


All Articles