code: func (c *Client) Enroll(enrollmentID string, opts ...EnrollmentOption) error {
  
  	eo := enrollmentOptions{}
  	for _, param := range opts {
  		err := param(&eo)
  		if err != nil {
  			return errors.WithMessage(err, "failed to enroll")
  		}
  	}
  
  	ca, err := newCAClient(c.ctx, c.orgName)
  	if err != nil {
  		return err
  	}
  
  	req := &mspapi.EnrollmentRequest{
  		Name:    enrollmentID,
  		Secret:  eo.secret,
  		Profile: eo.profile,
  		Type:    eo.typ,
  		Label:   eo.label,
  	}
  
  	if len(eo.attrReqs) > 0 {
  		attrs := make([]*mspapi.AttributeRequest, 0)
  		for _, attr := range eo.attrReqs {
  			attrs = append(attrs, &mspapi.AttributeRequest{Name: attr.Name, Optional: attr.Optional})
  		}
  		req.AttrReqs = attrs
  	}
  
  	return ca.Enroll(req)
  }
docs: // Enroll enrolls a registered user in order to receive a signed X509 certificate.
  // A new key pair is generated for the user. The private key and the
  // enrollment certificate issued by the CA are stored in SDK stores.
  // They can be retrieved by calling IdentityManager.GetSigningIdentity().
  //  Parameters:
  //  enrollmentID enrollment ID of a registered user
  //  opts are optional enrollment options
  //
  //  Returns:
  //  an error if enrollment fails