func (c *Client) GenerateUserCert(
	key []byte, user string, ttl time.Duration) ([]byte, error) {

	out, err := c.PostJSON(c.Endpoint("ca", "user", "certs"),
		generateUserCertReq{
			Key:  key,
			User: user,
			TTL:  ttl,
		})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	var cert string
	if err := json.Unmarshal(out.Bytes(), &cert); err != nil {
		return nil, trace.Wrap(err)
	}
	return []byte(cert), nil
}
// GenerateUserCert takes the public key in the Open SSH ``authorized_keys``
// plain text format, signs it using User Certificate Authority signing key and returns the
// resulting certificate.
GenerateUserCert takes the public key in the Open SSH ``authorized_keys``
plain text format, signs it using User Certificate Authority signing key and returns the
resulting certificate.
// GenerateUserCert takes the public key in the Open SSH ` ` authorized_keys ` ` // plain text format signs it using User Certificate Authority signing key and returns the // resulting certificate .
func (c *Client) GenerateUserCert(
	key []byte, user string, ttl time.Duration) ([]byte, error) {
	out, err := c.PostJSON(c.Endpoint("ca", "user", "certs"),
		generateUserCertReq{
			Key:  key,
			User: user,
			TTL:  ttl,
		})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	var cert string
	if err := json.Unmarshal(out.Bytes(), &cert); err != nil {
		return nil, trace.Wrap(err)
	}
	return []byte(cert), nil
}
func ( c * Client ) GenerateUserCert ( key [ ] byte , user string , ttl time . Duration ) ( [ ] byte , error ) { out , err := c . PostJSON ( c . Endpoint ( " " , " " , " " ) , generateUserCertReq { Key : key , User : user , TTL : ttl , } ) if err != nil { return nil , trace . Wrap ( err ) } var cert string if err := json . Unmarshal ( out . Bytes ( ) , & cert ) ; err != nil { return nil , trace . Wrap ( err ) } return [ ] byte ( cert ) , nil }
GenerateUserCert takes the public key in the Open SSH ``authorized_keys``
plain text format, signs it using User Certificate Authority signing key and returns the
resulting certificate.
GenerateUserCert takes the public key in the Open SSH ` ` authorized_keys ` ` plain text format signs it using User Certificate Authority signing key and returns the resulting certificate .