def generateCertificateFiles(basename, organization, organizationalUnit):
 (pkey, req, cert) = generateCertificateObjects(organization, organizationalUnit)
 for (ext, obj, dumpFunc) in [('key', pkey, crypto.dump_privatekey), ('req', req, crypto.dump_certificate_request), ('cert', cert, crypto.dump_certificate)]:
  fName = os.extsep.join((basename, ext)).encode('utf-8')
  FilePath(fName).setContent(dumpFunc(crypto.FILETYPE_PEM, obj))

def generateCertificateFiles ( basename , organization , organizationalUnit ) : ( pkey , req , cert ) = generateCertificateObjects ( organization , organizationalUnit ) for ( ext , obj , dumpFunc ) in [ ( 'key' , pkey , crypto . dump_privatekey ) , ( 'req' , req , crypto . dump_certificate_request ) , ( 'cert' , cert , crypto . dump_certificate ) ] : fName = os . extsep . join ( ( basename , ext ) ) . encode ( 'utf-8' ) FilePath ( fName ) . setContent ( dumpFunc ( crypto . FILETYPE_PEM , obj ) )
create certificate files key .