from OpenSSL import crypto
p12 = crypto.load_pkcs12(open('/path/to/cert.p12', 'rb').read(), passwd)
p12.get_certificate()
p12.get_privatekey()
Python: reading a pkcs12 certificate with pyOpenSSL.crypto