How to convert PyOpenSSL object to PEM-encoded string?

自闭症网瘾萝莉.ら 提交于 2019-12-24 11:34:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!