code: func (c *Client) GenerateHostCert(
  	key []byte, hostID, nodeName string, principals []string, clusterName string, roles teleport.Roles, ttl time.Duration) ([]byte, error) {
  
  	out, err := c.PostJSON(c.Endpoint("ca", "host", "certs"),
  		generateHostCertReq{
  			Key:         key,
  			HostID:      hostID,
  			NodeName:    nodeName,
  			Principals:  principals,
  			ClusterName: clusterName,
  			Roles:       roles,
  			TTL:         ttl,
  		})
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	var cert string
  	if err := json.Unmarshal(out.Bytes(), &cert); err != nil {
  		return nil, err
  	}
  
  	return []byte(cert), nil
  }
docs: // GenerateHostCert takes the public key in the Open SSH ``authorized_keys``
  // plain text format, signs it using Host Certificate Authority private key and returns the
  // resulting certificate.