# JWT implementation in Java using .pem

**URL:** <https://community.auth0.com/t/jwt-implementation-in-java-using-pem/65338>\
**Category:** JWT.io\
**Created:** [June 30, 2021, 2:37pm UTC](https://community.auth0.com/t/jwt-implementation-in-java-using-pem/65338 "2021-06-30T14:37:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev2021](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev2021/32/30294_2.png) [@dev2021](https://community.auth0.com/u/dev2021)\
**Post date:** [June 30, 2021, 2:37pm UTC](https://community.auth0.com/t/jwt-implementation-in-java-using-pem/65338/1 "2021-06-30T14:37:51Z")

</div>

Would like to know if JWT implementation (generating token) in Java is only possible only via .jks file in keystore of we can do it using a .pem (certificate and key) file as well ?

I would like to store the .jks file in a secured location offered by the PaaS provider on which my application is running and this service does not allow a physical file to be stored but rather the encoded format of the binary contents can be stored in key value pair which we have to refer by decoding. However when i do so , I get a Invalid keystore error.Hence i would like to know if .jks is a mandate for JWT token generation ?

---

<div class="post-metadata">

**Author:** ![thameera](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thameera/32/13430_2.png) [@thameera](https://community.auth0.com/u/thameera)\
**Post date:** [July 7, 2021, 12:04pm UTC](https://community.auth0.com/t/jwt-implementation-in-java-using-pem/65338/2 "2021-07-07T12:04:23Z")

</div>

Hey @dev2021 , the `java-jwt` library supports generating JWTs both with JWKS providers and with public/private key pairs directly. The RSA256 example here shows how to use a key pair: [GitHub - auth0/java-jwt: Java implementation of JSON Web Token (JWT)](https://github.com/auth0/java-jwt#create-and-sign-a-token)

---

<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 22, 2021, 12:04pm UTC](https://community.auth0.com/t/jwt-implementation-in-java-using-pem/65338/3 "2021-07-22T12:04:46Z")

</div>

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