-
I want to import a JWK Set and create a key repository from local json, which contains one EdDSA private key with public key and one RSA public key. I tried Here's the code: let jwks = jose.createLocalJWKSet(JSON.parse(readFileSync('jwks/jwks.json', 'ascii'));
console.log(await jwks()) // Just check what's inside The {
"keys": [
{
"crv": "Ed25519",
"d": "-cdzpj03IklApYAMK6_XclLUTlJ0hrf_uaZudb4o_VI",
"x": "Eg7eFX5rI7_xhDTvrv5LA7op1xdQ1NwMORr9CPadVNQ",
"kty": "OKP",
"alg": "EdDSA",
"use": "sig",
"kid": "111111"
},
{
"kty": "RSA",
"n": "sd-lDSZtBp38z6JqB1hIDXsGFCBA6bNPecbKEdCygW_h4K4AdSNYAfNaYCJqOfq-JKHMeIL69MKp7MG8D9pXyzcuHoL0XNhB3clJacU_ypGjiwCUsOKVxxLKElzBk6Ehelci7JS_HMNIKcwYWgfVy-85N7dT604VYxU5LT_Mps1CLpAXLt8No-RDn-RXnm5ekG5pSzDWkQMrrS6oNWR4hdOSk8vlNSFTKoKhZL5HRyxhfHV-WV70KMXsFci9eq8mUI8ikqbZq3vmyvcH2y9l7wJxwfXdOy8aFI4Hs1Go4-FXFlWnBlrBJhCi_SGlZtVfreV1tDlxqXK-2HFOsG-gnr0UlI79GpC_aRdNl28JU2PbgWo7ILdsMo1URYWEgXl1A-IMlN2Y2RLzp7T0Tu9hO6nUWjL5b9-dt38rheA_S0r_McHgL6WpOs8Qtmwy_5vU248BkrSktOBf5GFFTK7Te-b6w-7ag0JC4w-MyDNuPkNIDXmcVtrQQhGXIwP6qgOWV5RKKls3_S-LOEUgy7UpZjsNDCw3qV8lyn0zr3Z2TRSLEodLRb6FaJLmlKe8KXk-tMK8uraxFHIsoT_QHfU_SHwQifiiEeRnPPy2NRdJueH6yx3YyG-35LPgPZiGI5ks5kBQr93KU6Vs6nx3ahi5mHXXM3T62y8KBIi2LgAWMNc",
"e": "AQAB",
"use": "sig",
"alg": "RS256",
"kid": "222222"
}
]
} (The Ed25519 private key is generated randomly and will not be used in production so it's OK to show here) I've also tried import these two keys separately with So where the problem is? Please help. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That's not the intended use of the function. Your JWKS is fine, actually use it in jwtVerify to see it working. |
Beta Was this translation helpful? Give feedback.
That's not the intended use of the function. Your JWKS is fine, actually use it in jwtVerify to see it working.