code: func initialCAHandler(w http.ResponseWriter, r *http.Request) error {
  	log.Info("setting up initial CA handler")
  	body, err := ioutil.ReadAll(r.Body)
  	if err != nil {
  		log.Warningf("failed to read request body: %v", err)
  		return errors.NewBadRequest(err)
  	}
  	r.Body.Close()
  
  	req := new(csr.CertificateRequest)
  	req.KeyRequest = csr.NewBasicKeyRequest()
  	err = json.Unmarshal(body, req)
  	if err != nil {
  		log.Warningf("failed to unmarshal request: %v", err)
  		return errors.NewBadRequest(err)
  	}
  
  	cert, _, key, err := initca.New(req)
  	if err != nil {
  		log.Warningf("failed to initialise new CA: %v", err)
  		return err
  	}
  
  	response := api.NewSuccessResponse(&NewCA{string(key), string(cert)})
  
  	enc := json.NewEncoder(w)
  	err = enc.Encode(response)
  	return err
  }
docs: // initialCAHandler is an HTTP handler that accepts a JSON blob in the
  // same format as the CSR endpoint; this blob should contain the
  // identity information for the CA's root key. This endpoint is not
  // suitable for creating intermediate certificates.