func (c *Client) GenerateHostCert(
	key []byte, hostname, authDomain string, roles teleport.Roles, ttl time.Duration) ([]byte, error) {

	out, err := c.PostJSON(c.Endpoint("ca", "host", "certs"),
		generateHostCertReq{
			Key:        key,
			Hostname:   hostname,
			AuthDomain: authDomain,
			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
}
// 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.
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.
// 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 .
func (c *Client) GenerateHostCert(
	key []byte, hostname, authDomain string, roles teleport.Roles, ttl time.Duration) ([]byte, error) {
	out, err := c.PostJSON(c.Endpoint("ca", "host", "certs"),
		generateHostCertReq{
			Key:        key,
			Hostname:   hostname,
			AuthDomain: authDomain,
			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
}
func ( c * Client ) GenerateHostCert ( key [ ] byte , hostname , authDomain string , roles teleport . Roles , ttl time . Duration ) ( [ ] byte , error ) { out , err := c . PostJSON ( c . Endpoint ( " " , " " , " " ) , generateHostCertReq { Key : key , Hostname : hostname , AuthDomain : authDomain , 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 }
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.
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 .