code: func (c *fabricCAAdapter) Enroll(request *api.EnrollmentRequest) ([]byte, error) {
  
  	logger.Debugf("Enrolling user [%s]", request.Name)
  
  	// TODO add attributes
  	careq := &caapi.EnrollmentRequest{
  		CAName:  c.caClient.Config.CAName,
  		Name:    request.Name,
  		Secret:  request.Secret,
  		Profile: request.Profile,
  		Type:    request.Type,
  		Label:   request.Label,
  	}
  
  	if len(request.AttrReqs) > 0 {
  		attrs := make([]*caapi.AttributeRequest, len(request.AttrReqs))
  		for i, a := range request.AttrReqs {
  			attrs[i] = &caapi.AttributeRequest{Name: a.Name, Optional: a.Optional}
  		}
  		careq.AttrReqs = attrs
  	}
  
  	caresp, err := c.caClient.Enroll(careq)
  	if err != nil {
  		return nil, errors.WithMessage(err, "enroll failed")
  	}
  	return caresp.Identity.GetECert().Cert(), nil
  }
docs: // Enroll handles enrollment.