docs: def update(cls, cert_id, csr, private_key, country, state, city,
                 organisation, branch, altnames, dcv_method):
          """ Update a certificate. """
          cert = cls.info(cert_id)
          if cert['status'] != 'valid':
              cls.error('The certificate must be in valid status to be updated.')
              return
  
          common_name = cert['cn']
  
          csr = cls.process_csr(common_name, csr, private_key, country, state,
                                city, organisation, branch)
  
          if not csr:
              return
  
          params = {'csr': csr}
          if altnames:
              params['altnames'] = []
              for altname in altnames:
                  params['altnames'].extend(altname.split(','))
          if dcv_method:
              params['dcv_method'] = dcv_method
  
          try:
              result = cls.call('cert.update', cert_id, params)
          except UsageError:
              params['--dry-run'] = True
              msg = cls.call('cert.update', cert_id, params)
              if msg:
                  cls.error(str(msg))
              raise
  
          return result