# Mender.conf: Where to configure the public key for Security.AuthPrivateKey?

**URL:** <https://hub.mender.io/t/mender-conf-where-to-configure-the-public-key-for-security-authprivatekey/5385>\
**Category:** General Discussions\
**Tags:** authentication\
**Created:** [November 11, 2022, 1:39pm UTC](https://hub.mender.io/t/mender-conf-where-to-configure-the-public-key-for-security-authprivatekey/5385 "2022-11-11T13:39:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaomai](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@shaomai](https://hub.mender.io/u/shaomai)\
**Post date:** [November 11, 2022, 1:39pm UTC](https://hub.mender.io/t/mender-conf-where-to-configure-the-public-key-for-security-authprivatekey/5385/1 "2022-11-11T13:39:53Z")

</div>

Hi everyone,

I’m new in mender hub and trying to configure the `Security.AuthPrivateKey` for device authentication with a HSM.

I read the [mender docs](https://docs.mender.io/client-installation/configuration-file/configuration-options) and it seems that there is no `public key` field in `Security`. If I use manual authentication, I am supposed to transfer public key to device, so that server can use the public key to verify the auth requests from client.

My question is: if I use hosted mender, how does the server know the public key of the private key?

---

<div class="post-metadata">

**Author:** ![shaomai](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@shaomai](https://hub.mender.io/u/shaomai)\
**Post date:** [November 11, 2022, 8:24pm UTC](https://hub.mender.io/t/mender-conf-where-to-configure-the-public-key-for-security-authprivatekey/5385/2 "2022-11-11T20:24:45Z")

</div>

I just found out that mender client will extract the public key from `Security.AuthPrivateKey`, therefore there is no need to specify the public key in the field.

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [November 16, 2022, 9:29pm UTC](https://hub.mender.io/t/mender-conf-where-to-configure-the-public-key-for-security-authprivatekey/5385/3 "2022-11-16T21:29:50Z")

</div>

@shaomai

I take it we can mark the second post as solution?

Greetz

---

<div class="post-metadata">

**Author:** ![shaomai](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@shaomai](https://hub.mender.io/u/shaomai)\
**Post date:** [November 16, 2022, 9:31pm UTC](https://hub.mender.io/t/mender-conf-where-to-configure-the-public-key-for-security-authprivatekey/5385/4 "2022-11-16T21:31:54Z")

</div>

yes, the second reply is the solution
