def gen_pkcs12(self, cert_pem=None, key_pem=None, ca_pem=None,<EOL>friendly_name=None):
p12 = PKCS12()<EOL>if cert_pem:<EOL><INDENT>ret = p12.set_certificate(load_certificate(FILETYPE_PEM, cert_pem))<EOL>assert ret is None<EOL><DEDENT>if key_pem:<EOL><INDENT>ret = p12.set_privatekey(load_privatekey(FILETYPE_PEM, key_pem))<EOL>assert ret is None<EOL><DEDENT>if ca_pem:<EOL><INDENT>ret = p12.set_ca_certificates(<EOL>(load_certificate(FILETYPE_PEM, ca_pem),)<EOL>)<EOL>assert ret is None<EOL><DEDENT>if friendly_name:<EOL><INDENT>ret = p12.set_friendlyname(friendly_name)<EOL>assert ret is None<EOL><DEDENT>return p12<EOL>
Generate a PKCS12 object with components from PEM.  Verify that the set
functions return None.