-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @xiazihang The createRemoteJWKSet is not intended for use with JWE. I thought that was clear from its documentation or typings, which mention only JWS, not JWE, but clearly I was wrong there and will try to improve. The function serves to resolve public keys only because key resolver functions for JWS/JWT need to return a public/secret key. On the other hand, JWE consuming function key resolvers need to resolve a private key to decrypt, which is never distributed via a public JWKS endpoint. In short, the function is meant for JWS, not JWE and that's why the "search key logic", as you call it, is the way it is. |
Beta Was this translation helpful? Give feedback.
As I wrote, use
fetch
to get the jwks, parse it, find the JWK you want to use, and then usejose.importJWK
.