code: func (c *fabricCAAdapter) GetAllIdentities(key core.Key, cert []byte, caname string) ([]*api.IdentityResponse, error) {
  
  	logger.Debug("Retrieving all identities")
  
  	registrar, err := c.newIdentity(key, cert)
  	if err != nil {
  		return nil, errors.Wrap(err, "failed to create CA signing identity")
  	}
  
  	var identities []caapi.IdentityInfo
  
  	err = registrar.GetAllIdentities(caname, func(decoder *json.Decoder) error {
  		var identity caapi.IdentityInfo
  		decodeErr := decoder.Decode(&identity)
  		if decodeErr != nil {
  			return decodeErr
  		}
  
  		identities = append(identities, identity)
  		return nil
  	})
  
  	if err != nil {
  		return nil, errors.Wrap(err, "failed to get identities")
  	}
  
  	return getIdentityResponses(c.caClient.Config.CAName, identities), nil
  }
docs: // GetAllIdentities returns all identities that the caller is authorized to see
  // key: registrar private key
  // cert: registrar enrollment certificate