# Java-jwt - How to supply RSA keys?

**URL:** <https://community.auth0.com/t/java-jwt-how-to-supply-rsa-keys/109609>\
**Category:** Get Help\
**Created:** [June 20, 2023, 4:42pm UTC](https://community.auth0.com/t/java-jwt-how-to-supply-rsa-keys/109609 "2023-06-20T16:42:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chanan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chanan/32/48187_2.png) [@chanan](https://community.auth0.com/u/chanan)\
**Post date:** [June 20, 2023, 4:42pm UTC](https://community.auth0.com/t/java-jwt-how-to-supply-rsa-keys/109609/1 "2023-06-20T16:42:23Z")

</div>

Hello,

I signed up for Auth0 and created an application and API. The code base we have is okd version JAX-RS and I haven’t been able to use the quickstarts. So I would like to use java-jwt to verify the token in the API.

However, so setup java-jwt you need the public and private key RSA keys.

1. Why do I need the to supply the keys? shouldn’t the library get them from the “well-known” urls?
2. Why would I need the private key at all to verify jwt tokens?

Thanks,  
Chanan

---

<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:** [June 20, 2023, 9:43pm UTC](https://community.auth0.com/t/java-jwt-how-to-supply-rsa-keys/109609/3 "2023-06-20T21:43:50Z")

</div>

Hey there @chanan welcome to the community!

> [@chanan](#):
>
> Why do I need the to supply the keys? shouldn’t the library get them from the “well-known” urls?

This library does not support obtaining keys from a JWKS endpoint (well-known) - You could utilize our [jwks-rsa-java](https://github.com/auth0/jwks-rsa-java) as well to implement obtaining keys. See [this documentation](https://github.com/auth0/java-jwt/blob/master/EXAMPLES.md#using-a-keyprovider) as well.

> [@chanan](#):
>
> Why would I need the private key at all to verify jwt tokens?

I don’t believe the private key is required - Have you tried omitting it or simply passing `null`?

Keep us posted!

---

<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:** [July 4, 2023, 9:43pm UTC](https://community.auth0.com/t/java-jwt-how-to-supply-rsa-keys/109609/4 "2023-07-04T21:43:53Z")

</div>

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