// ListPrivateKeyIDs returns a parsed list of GPG secret keys
162189
func (g *GPG) ListPrivateKeyIDs(ctx context.Context) ([]string, error) {
	if g.privKeys == nil {
		kl, err := g.listKeys(ctx, "secret")
		if err != nil {
			return nil, err
		}
		g.privKeys = kl
	}
	if gpg.IsAlwaysTrust(ctx) {
		return g.privKeys.Recipients(), nil
	}
	return g.privKeys.UseableKeys().Recipients(), nil
}
744201
func (c *Client) ListKeys() ([]Key, error) {
	var resp []Key
	req := request{
		method: client.GET,
		url:    apiKeys,
		resp:   &resp,
	}
	if _, err := c.sendRequest(req); err != nil {
		return nil, errors.Newf(err, "failed to get list of keys")
	}
	return resp, nil
}
583756
func (api *API) ListPrivateNetworkServers(pn_id string) ([]Identity, error) {
	result := []Identity{}
	url := createUrl(api, privateNetworkPathSegment, pn_id, "servers")
	err := api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	return result, nil
}
300930
func (ks *KeyStore) ListCerts() []string {
	var r []string
	for k, v := range ks.entries {
		if _, ok := v.(*trustedCertEntry); ok {
			r = append(r, k)
		}
	}
	return r
}
714643
func WithPrivateKey(key []byte) SigningIdentityOption {
	return func(o *IdentityOption) error {
		o.PrivateKey = key
		return nil
	}
}
1175253
func (e *Ed25519) PublicKeys(keyIDs ...string) (map[string]data.PublicKey, error) {
	k := make(map[string]data.PublicKey)
	for _, keyID := range keyIDs {
		if edKey, ok := e.keys[keyID]; ok {
			k[keyID] = data.PublicKeyFromPrivate(edKey.privKey)
		}
	}
	return k, nil
}
74075
func (c *Client) ListPrivateNetworksForServer(id string) (nets []PrivateNetwork, err error) {
	var netMap map[string]PrivateNetwork
	if err := c.get(`server/private_networks?SUBID=`+id, &netMap); err != nil {
		return nil, err
	}

	for _, net := range netMap {
		nets = append(nets, net)
	}
	sort.Sort(privateNetworks(nets))
	return nets, nil
}
1011875
func (a *Agent) ListKeys() (*KeyringResponse, error) {
	var resp KeyringResponse
	_, err := a.client.query("/v1/agent/keyring/list", &resp, nil)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
595107
func HDPrivateKeyToPublicKeyID(id []byte) ([]byte, error) {
	if len(id) != 4 {
		return nil, ErrUnknownHDKeyID
	}

	var key [4]byte
	copy(key[:], id)
	pubBytes, ok := hdPrivToPubKeyIDs[key]
	if !ok {
		return nil, ErrUnknownHDKeyID
	}

	return pubBytes, nil
}
294645
func (db *BytesConnectionRedis) ListKeys(match string) (keyval.BytesKeyIterator, error) {
	if db.closed {
		return nil, fmt.Errorf("ListKeys(%s) called on a closed connection", match)
	}
	return listKeys(db, match, nil, nil)
}
873026
func ListPublicKeys(uid int64) ([]*PublicKey, error) {
	keys := make([]*PublicKey, 0, 5)
	return keys, x.Where("owner_id = ?", uid).Find(&keys)
}
956310
func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opt *ListOptions) ([]*Key, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/keys", owner, repo)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var keys []*Key
	resp, err := s.client.Do(ctx, req, &keys)
	if err != nil {
		return nil, resp, err
	}

	return keys, resp, nil
}
1299915
func ListDeployKeys(repoID int64) ([]*DeployKey, error) {
	keys := make([]*DeployKey, 0, 5)
	return keys, x.Where("repo_id = ?", repoID).Find(&keys)
}
1048530
func (p *Secring) KeyIDs() []string {
	p.Lock()
	defer p.Unlock()

	ids := make([]string, 0, len(p.data.PrivateKeys))
	for _, pk := range p.data.PrivateKeys {
		ids = append(ids, pk.PublicKey.Fingerprint)
	}
	sort.Strings(ids)
	return ids
}
1181770
func ListPrivateKeys(ctx context.Context, c *cli.Context) error {
	if err := initCrypto(); err != nil {
		return action.ExitError(ctx, action.ExitUnknown, err, "failed to init XC")
	}

	kl, err := crypto.ListPrivateKeyIDs(ctx)
	if err != nil {
		return action.ExitError(ctx, action.ExitUnknown, err, "failed to list private keys")
	}

	out.Print(ctx, "XC Private Keys:")
	for _, key := range kl {
		out.Print(ctx, "%s - %s", key, crypto.FormatKey(ctx, key))
	}

	return nil
}
696421
func (g *GPGKey) GetPrimaryKeyID() int64 {
	if g == nil || g.PrimaryKeyID == nil {
		return 0
	}
	return *g.PrimaryKeyID
}
516366
func (c PGPClient) PGPPullPrivate(ctx context.Context, __arg PGPPullPrivateArg) (err error) {
	err = c.Cli.Call(ctx, "keybase.1.pgp.pgpPullPrivate", []interface{}{__arg}, nil)
	return
}