':py:obj:`PKCS12.set_certificate` replaces the certificate in a PKCS12 cluster.
:py:obj:`PKCS12.set_privatekey` replaces the private key.
:py:obj:`PKCS12.set_ca_certificates` replaces the CA certificates.'

def test_replace(self):

    p12 = self.gen_pkcs12(client_cert_pem, client_key_pem, root_cert_pem)
    p12.set_certificate(load_certificate(FILETYPE_PEM, server_cert_pem))
    p12.set_privatekey(load_privatekey(FILETYPE_PEM, server_key_pem))
    root_cert = load_certificate(FILETYPE_PEM, root_cert_pem)
    client_cert = load_certificate(FILETYPE_PEM, client_cert_pem)
    p12.set_ca_certificates([root_cert])
    self.assertEqual(1, len(p12.get_ca_certificates()))
    self.assertEqual(root_cert, p12.get_ca_certificates()[0])
    p12.set_ca_certificates([client_cert, root_cert])
    self.assertEqual(2, len(p12.get_ca_certificates()))
    self.assertEqual(client_cert, p12.get_ca_certificates()[0])
    self.assertEqual(root_cert, p12.get_ca_certificates()[1])
