# With RS256, if the private key is rotated, can old pubic key validate the JWT signature?

**URL:** <https://community.auth0.com/t/with-rs256-if-the-private-key-is-rotated-can-old-pubic-key-validate-the-jwt-signature/113587>\
**Category:** Get Help\
**Tags:** documentation-incorrect, customer-feedback\
**Created:** [August 14, 2023, 3:11pm UTC](https://community.auth0.com/t/with-rs256-if-the-private-key-is-rotated-can-old-pubic-key-validate-the-jwt-signature/113587 "2023-08-14T15:11:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anlexN](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anlexn/32/49887_2.png) [@anlexN](https://community.auth0.com/u/anlexN)\
**Post date:** [August 14, 2023, 3:11pm UTC](https://community.auth0.com/t/with-rs256-if-the-private-key-is-rotated-can-old-pubic-key-validate-the-jwt-signature/113587/1 "2023-08-14T15:11:01Z")

</div>

I am fresh man, and reviewing docs step by step.  
[Signing Algorithms](https://auth0.com/docs/get-started/applications/signing-algorithms)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/0/2/02cfe8a26dc1a5ee9611e3b43a390003ab17d453.png)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 15, 2023, 12:22am UTC](https://community.auth0.com/t/with-rs256-if-the-private-key-is-rotated-can-old-pubic-key-validate-the-jwt-signature/113587/3 "2023-08-15T00:22:37Z")

</div>

Hey @anlexN welcome to the community!

When the private key is rotated, only the linked public keys will work to validate any subsequently minted tokens. To answer your question, no a pre-existing public key cannot validate any JWT created using the new private key. The statement you’ve pointed out is true because SDKs using RS256 to validate tokens will have access to your tenants `/.well-known/jwks.json` endpoint with the updated public keys.

> **[JSON Web Key Sets](https://auth0.com/docs/secure/tokens/json-web-tokens/json-web-key-sets)**
>
> A JSON Web Key set is a JSON object which represents a set of JSON Web Keys (a JSON object that represents a cryptographic key).

For example, [jwksUri](https://auth0.github.io/node-oauth2-jwt-bearer/interfaces/AuthOptions.html#jwksUri) OR [issuerBaseURL](https://auth0.github.io/node-oauth2-jwt-bearer/interfaces/AuthOptions.html#issuerBaseURL) in [express-oauth2-jwt-bearer](https://github.com/auth0/node-oauth2-jwt-bearer/tree/main/packages/express-oauth2-jwt-bearer).

Hope this helps to clarify!

---

<div class="post-metadata">

**Author:** ![anlexN](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anlexn/32/49887_2.png) [@anlexN](https://community.auth0.com/u/anlexN)\
**Post date:** [August 17, 2023, 12:38pm UTC](https://community.auth0.com/t/with-rs256-if-the-private-key-is-rotated-can-old-pubic-key-validate-the-jwt-signature/113587/4 "2023-08-17T12:38:01Z")

</div>

@tyf  
thank you very much, teacher! can you also answer my another [question](https://community.auth0.com/t/what-information-about-the-relationship-is-retained-by-the-authorization-server/113860)?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 17, 2023, 10:17pm UTC](https://community.auth0.com/t/with-rs256-if-the-private-key-is-rotated-can-old-pubic-key-validate-the-jwt-signature/113587/5 "2023-08-17T22:17:29Z")

</div>

No problem, happy to help!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 31, 2023, 10:18pm UTC](https://community.auth0.com/t/with-rs256-if-the-private-key-is-rotated-can-old-pubic-key-validate-the-jwt-signature/113587/6 "2023-08-31T22:18:15Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
