# Get key by name

**URL:** <https://discuss.ipfs.tech/t/get-key-by-name/17901>\
**Category:** Kubo\
**Created:** [April 22, 2024, 9:17am UTC](https://discuss.ipfs.tech/t/get-key-by-name/17901 "2024-04-22T09:17:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![h30x](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/h30x/32/8463_2.png) [@h30x](https://discuss.ipfs.tech/u/h30x)\
**Post date:** [April 22, 2024, 9:17am UTC](https://discuss.ipfs.tech/t/get-key-by-name/17901/1 "2024-04-22T09:17:54Z")

</div>

It is possible to list the key/name pairs like this:

```sh
> ipfs key list -l --ipns-base b58mh
12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv self           
12D3KooWMNrGeGSAMw64MCBsqiFy3B67vZb6bRmHnxsT9QazWBAL test1
12D3KooWSBaU3k8BSmKZS319v7uqHabrXqxidxAnveiL3NjfYZgm test2  
12D3KooWDisrDBrcQfjGcYd7iGin8JoTmSMva5isCDuu9kieUR7H test3 

```

It would be nice to add a way to get a key by name like:

```sh
> ipfs key get --name test2
12D3KooWSBaU3k8BSmKZS319v7uqHabrXqxidxAnveiL3NjfYZgm

```

Is it worth opening a feature request issue on [kubo repo](https://github.com/ipfs/kubo/issues/new/choose)? I do not see an existing one.

PS: related to [How IPNS, "ipfs key" keystore file name are made?](https://discuss.ipfs.tech/t/how-ipns-ipfs-key-keystore-file-name-are-made/11545) which answers how to get the key in command line. It should also be possible via the RPC API.

---

<div class="post-metadata">

**Author:** ![bahner](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/bahner/32/8214_2.png) [@bahner](https://discuss.ipfs.tech/u/bahner)\
**Post date:** [April 23, 2024, 5:57pm UTC](https://discuss.ipfs.tech/t/get-key-by-name/17901/2 "2024-04-23T17:57:17Z")

</div>

Just an amateur in this regard, but I believe this is by design. Ref. [ipfs key export (key with name doesn't exist) · Issue #8327 · ipfs/kubo · GitHub](https://github.com/ipfs/kubo/issues/8327#issuecomment-893450924)

---

<div class="post-metadata">

**Author:** ![h30x](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/h30x/32/8463_2.png) [@h30x](https://discuss.ipfs.tech/u/h30x)\
**Post date:** [April 23, 2024, 11:07pm UTC](https://discuss.ipfs.tech/t/get-key-by-name/17901/3 "2024-04-23T23:07:37Z")

</div>

You are right that the private key should not be accessible this way, but my message was about the public key, which is the IPNS entry

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [April 25, 2024, 1:30pm UTC](https://discuss.ipfs.tech/t/get-key-by-name/17901/4 "2024-04-25T13:30:47Z")

</div>

Feel free to open a feature request or better yet, a PR.

I agree that this would be useful.

---

<div class="post-metadata">

**Author:** ![h30x](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/h30x/32/8463_2.png) [@h30x](https://discuss.ipfs.tech/u/h30x)\
**Post date:** [May 2, 2024, 10:20am UTC](https://discuss.ipfs.tech/t/get-key-by-name/17901/5 "2024-05-02T10:20:27Z")

</div>

No time yet to open a PR, so here is the feature request: [Get key by name · Issue #10415 · ipfs/kubo · GitHub](https://github.com/ipfs/kubo/issues/10415).
