使い方はかなり簡単です。これはテストされていませんが、動作するはずです:
# load OpenSSL.crypto
from OpenSSL import crypto
# open it, using password. Supply/read your own from stdin.
p12 = crypto.load_pkcs12(open("/path/to/cert.p12", 'rb').read(), passwd)
# get various properties of said file.
# note these are PyOpenSSL objects, not strings although you
# can convert them to PEM-encoded strings.
p12.get_certificate() # (signed) certificate object
p12.get_privatekey() # private key.
p12.get_ca_certificates() # ca chain.
その他の例については、pyopenssl の単体テスト コードを参照してください。ライブラリを使用したいと思うかもしれないほとんどすべての方法がそこにあります
こちらもご覧くださいまたは広告なしこちら.