'Generate a PKCS12 object with components from PEM.  Verify that the set
functions return None.'

def gen_pkcs12(self, cert_pem=None, key_pem=None, ca_pem=None, friendly_name=None):

    p12 = PKCS12()
    if cert_pem:
        ret = p12.set_certificate(load_certificate(FILETYPE_PEM, cert_pem))
        self.assertEqual(ret, None)
    if key_pem:
        ret = p12.set_privatekey(load_privatekey(FILETYPE_PEM, key_pem))
        self.assertEqual(ret, None)
    if ca_pem:
        ret = p12.set_ca_certificates((load_certificate(FILETYPE_PEM, ca_pem),))
        self.assertEqual(ret, None)
    if friendly_name:
        ret = p12.set_friendlyname(friendly_name)
        self.assertEqual(ret, None)
    return p12
