code: def process_csr(cls, common_name, csr=None, private_key=None,
                      country=None, state=None, city=None, organisation=None,
                      branch=None):
          
          if csr:
              if branch or organisation or city or state or country:
                  cls.echo('Following options are only used to generate'
                           ' the CSR.')
          else:
              params = (('CN', common_name),
                        ('OU', branch),
                        ('O', organisation),
                        ('L', city),
                        ('ST', state),
                        ('C', country))
              params = [(key, val) for key, val in params if val]
              csr = cls.create_csr(common_name, private_key, params)
  
          if csr and os.path.exists(csr):
              with open(csr) as fcsr:
                  csr = fcsr.read()
  
          return csr
docs: Create a PK and a CSR if needed.