-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bestJWSAlg should take a list of supported algorithms #118
Comments
Yes, that's a good idea. I will introduce a new function for this purpose, call it |
Add `Crypto.JOSE.JWK.negotiateJWSAlg` which chooses the cryptographically strongest JWS algorithm for a given key, optionally restricted to a given set of algorithms. #118
Add `Crypto.JOSE.JWK.negotiateJWSAlg` which chooses the cryptographically strongest JWS algorithm for a given key, optionally restricted to a given set of algorithms. #118
Yes, that looks suitable for the purpose. Thanks. For reference, here's a version of openid-connect that uses it: https://github.com/KSF-Media/openid-connect/tree/feature/negotiate-JWS-alg I could still suggest one change about it: Remove the |
@kaol, thanks for the feedback. I will implement the API change you suggested. I have some other changes in progress but I'll aim for a new release during the Christmas break. |
Add `Crypto.JOSE.JWK.negotiateJWSAlg` which chooses the cryptographically strongest JWS algorithm for a given key, restricted to a given set of algorithms. #118
Add `Crypto.JOSE.JWK.negotiateJWSAlg` which chooses the cryptographically strongest JWS algorithm for a given key, restricted to a given set of algorithms. #118
I think
bestJWSAlg
should take a list of algorithms supported by the recipient as well. The key may potentially support it but there's no guarantee that the recipient will recognize it. In particular, OpenID Connect's discovery document defines fieldsand in my case I was using
openid-connect
library which usesbestJWSAlg
which returnsPS512
but the provider I'm using only listsRS256
andHS256
in the discovery and usingPS512
got me only errors.The text was updated successfully, but these errors were encountered: