def pkcs12_key_as_pem(private_key_bytes, private_key_password):
 private_key_password = _helpers._to_bytes(private_key_password)
 pkcs12 = crypto.load_pkcs12(private_key_bytes, private_key_password)
 return crypto.dump_privatekey(crypto.FILETYPE_PEM, pkcs12.get_privatekey())

def pkcs12_key_as_pem ( private_key_bytes , private_key_password ) : private_key_password = _helpers . _to_bytes ( private_key_password ) pkcs12 = crypto . load_pkcs12 ( private_key_bytes , private_key_password ) return crypto . dump_privatekey ( crypto . FILETYPE_PEM , pkcs12 . get_privatekey ( ) )
convert the contents of a pkcs#12 key to pem using pyopenssl .