JWT implementation in Java using .pem

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 ?

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)

1 Like

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