问题
I'm trying to extract the private key and certificate from a PKCS12 file using pyOpenSSL, and am having a hard time figuring out how to convert the data to PEM-encoded strings. The question below implies that it's possible, but I haven't been able to figure it out.
Python: reading a pkcs12 certificate with pyOpenSSL.crypto
回答1:
Give a look on the dump_certificate, dump_certificate_request, dump_privatekey methods: http://pyopenssl.sourceforge.net/pyOpenSSL.html/openssl-crypto.html
来源:https://stackoverflow.com/questions/9509855/how-to-convert-pyopenssl-object-to-pem-encoded-string