// ListPublicKeyIDs does nothing
978495
func (g *GPG) ListPublicKeyIDs(context.Context) ([]string, error) {
	if g.pubring == nil {
		return nil, fmt.Errorf("pubring is not initialized")
	}
	ids := listKeyIDs(g.pubring)
	if g.secring != nil {
		ids = append(ids, listKeyIDs(g.secring)...)
	}
	return ids, nil
}
1209744
func (c UserClient) LoadPublicKeys(ctx context.Context, __arg LoadPublicKeysArg) (res []PublicKey, err error) {
	err = c.Cli.Call(ctx, "keybase.1.user.loadPublicKeys", []interface{}{__arg}, &res)
	return
}
445111
func (o *Organization) GetPublicRepos() int {
	if o == nil || o.PublicRepos == nil {
		return 0
	}
	return *o.PublicRepos
}
1146313
func (x *XC) findPublicKey(needle string) (*keyring.PublicKey, error) {
	for _, id := range x.pubring.KeyIDs() {
		if id == needle {
			return x.pubring.Get(id), nil
		}
	}
	return nil, fmt.Errorf("no sender found for id '%s'", needle)
}
175093
func listOrgs(stub shim.ChaincodeStubInterface) pb.Response {
	_, parameters := stub.GetFunctionAndParameters()
	if len(parameters) < 1 {
		return shim.Error("No key specified")
	}

	// get the endorsement policy for the key
	var epBytes []byte
	var err error
	if parameters[0] == "pub" {
		epBytes, err = stub.GetStateValidationParameter("pub")
	} else if parameters[0] == "priv" {
		epBytes, err = stub.GetPrivateDataValidationParameter("col", "priv")
	} else {
		return shim.Error("Unknown key specified")
	}
	ep, err := statebased.NewStateEP(epBytes)
	if err != nil {
		return shim.Error(err.Error())
	}

	// get the list of organizations in the endorsement policy
	orgs := ep.ListOrgs()
	orgsList, err := json.Marshal(orgs)
	if err != nil {
		return shim.Error(err.Error())
	}

	return shim.Success(orgsList)
}
982867
func (g *GPG) ListPrivateKeyIDs(context.Context) ([]string, error) {
	if g.secring == nil {
		return nil, fmt.Errorf("secring is not initialized")
	}
	return listKeyIDs(g.secring), nil
}
364242
func (p *ProfilesClient) ListByID(ctx context.Context, userIDs []identity.ID) ([]apitypes.Profile, error) {
	v := &url.Values{}
	for _, id := range userIDs {
		v.Add("id", id.String())
	}

	var results []apitypes.Profile
	err := p.client.RoundTrip(ctx, "GET", "/profiles", v, nil, &results)
	return results, err
}
1278906
func ListIPChannels(client *TwilioIPMessagingClient, serviceSid string) (*IPChannelList, error) {
	var channelList *IPChannelList

	body, err := client.get(nil, "/Services/"+serviceSid+"/Channels.json")

	if err != nil {
		return channelList, err
	}

	channelList = new(IPChannelList)
	channelList.Client = client
	err = json.Unmarshal(body, channelList)

	return channelList, err
}
411502
func GetPublicKey(c *context.APIContext) {
	key, err := models.GetPublicKeyByID(c.ParamsInt64(":id"))
	if err != nil {
		if models.IsErrKeyNotExist(err) {
			c.Status(404)
		} else {
			c.Error(500, "GetPublicKeyByID", err)
		}
		return
	}

	apiLink := composePublicKeysAPILink()
	c.JSON(200, convert.ToPublicKey(apiLink, key))
}
671587
func (api *API) ListPublicIps(args ...interface{}) ([]PublicIp, error) {
	url, err := processQueryParams(createUrl(api, publicIpPathSegment), args...)
	if err != nil {
		return nil, err
	}
	result := []PublicIp{}
	err = api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	for index, _ := range result {
		result[index].api = api
	}
	return result, nil
}
292582
func (mp ModelPayloads) ListAll() ([]payload.FullPayloadInfo, error) {
	coll, closer := mp.db.GetCollection(payloadsC)
	defer closer()

	var docs []payloadDoc
	if err := coll.Find(nil).All(&docs); err != nil {
		return nil, errors.Trace(err)
	}
	return nsPayloads.asPayloads(docs), nil
}
1320269
func (e *Engine) SignedPublicKey(ctx context.Context, body *primitive.PublicKey,
	sigID *identity.ID, sigKP *SignatureKeyPair) (*envelope.PublicKey, error) {
	id, sig, err := e.signAndID(ctx, body, sigID, sigKP)
	if err != nil {
		return nil, err
	}

	return &envelope.PublicKey{
		ID:        id,
		Version:   uint8(body.Version()),
		Body:      body,
		Signature: *sig,
	}, nil
}
1127506
func (o *Organization) GetPublicGists() int {
	if o == nil || o.PublicGists == nil {
		return 0
	}
	return *o.PublicGists
}
651950
func (g *GPG) ExportPublicKey(ctx context.Context, id string) ([]byte, error) {
	ent := g.findEntity(id)
	if ent == nil {
		return nil, fmt.Errorf("key not found")
	}

	buf := &bytes.Buffer{}
	err := ent.PrimaryKey.Serialize(buf)
	return buf.Bytes(), err
}
581443
func (c UnitFacadeClient) List(fullIDs ...string) ([]payload.Result, error) {
	var ids []string
	if len(fullIDs) > 0 {
		actual, err := c.lookUp(fullIDs)
		if err != nil {
			return nil, errors.Trace(err)
		}
		ids = actual
	}
	args := internal.IDs2ListArgs(ids)

	var rs params.PayloadResults
	if err := c.FacadeCall("List", &args, &rs); err != nil {
		return nil, errors.Trace(err)
	}

	return api2results(rs)
}
1149614
func (x *XC) FindPublicKeys(ctx context.Context, search ...string) ([]string, error) {
	ids := make([]string, 0, 1)
	candidates, _ := x.ListPublicKeyIDs(ctx)
	for _, needle := range search {
		for _, fp := range candidates {
			if strings.HasSuffix(fp, needle) {
				ids = append(ids, fp)
			}
		}
	}
	sort.Strings(ids)
	return ids, nil
}
1083751
func ListHooks(c *context.APIContext) {
	hooks, err := models.GetWebhooksByRepoID(c.Repo.Repository.ID)
	if err != nil {
		c.Error(500, "GetWebhooksByRepoID", err)
		return
	}

	apiHooks := make([]*api.Hook, len(hooks))
	for i := range hooks {
		apiHooks[i] = convert.ToHook(c.Repo.RepoLink, hooks[i])
	}
	c.JSON(200, &apiHooks)
}