Skip to content

Is Keys.password supported to sign JWT tokens? #993

Closed Answered by lhazlewood
pgmarc asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @pgmarc !

Plaintext passwords (and their Password type complement) are unsafe inputs for any cryptographic algorithms other than key derivation algorithms. Key derivation algorithms work by taking an unsafe input (like a poor-entropy text password) and they produce/output a cryptographically safe key that is sufficiently strong to use in the actual desired algorithm (e.g. signature algorithm, encryption algorithm, etc).

The only JWA-defined password input algorithms are for Key Encryption using PBES2, used during JWT encryption, not signing.

So, because .signWith attempts to find the most suitable mac or signature algorithm for the specified key, and as Password instances are not suita…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pgmarc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants