GOLANG是否从内存加载JWK(JSON Web密钥),而不是从URL加载? 取

I'm using "github.com/lestrrat/go-jwx/jwk" to Validate Jason Web Tokens (JWT). https://github.com/lestrrat/go-jwx

The JWK Library has a great function to load keys from a URL, but this would be running in a serverless environment, so I want to cache the keys rather than fetching them like this:

set, err := jwk.Fetch(keyUrl)

I'm trying to figure out how to load them directly, or create them from the keys I already have.

The keys are the JSON format.

{"keys":
[{"alg":"RS256","e":"AQAB","n":"jqm5oX5Vth4JW1gZQHywIki2beYCgBSL-
EYlefDUlI6SShtEKfi-vWYbFh2pNNUAE4NHuYpYP-
FG1uRSKs6WK2k6KMB2Hyx3hBkWyu7Aqo_pb1WItkPSZS-AWOMp4N-

I just can't find an example of how to do this. There must be a way

In case anyone else get's stuck on this, although I think it's unlikely, and thank you Stephen and Jonah for your patience.

jwk.Parse was exactly what I needed. There is even an option for a string.

set, err := jwk.ParseString(`{"keys":[{"alg":"RS256","e":"AQAB","n":"jqm5oX5Vth4JW1gZQHywIki2beYCgBSL-EYlefDUlI6SShtEKfi-vWYbFh2pNNUAE4NHuYpYP-FG1uRSKs6WK2k6KMB2Hyx3hBkWyu7Aqo_pb1WItkPSZS-AWOMp4N-ENPGyNQ4u2ill17ZwBKt1wgDvdaWpNaqPEcSaUNSXA7ZD5scFFnZt36r6crhgK7vHXChhXU3nlKEN2OwFdyEGdX01l-HxgPk0HPIfnUyYxuGI_CL-7aV_rf3KY4uw6yNfEO0jom0NZ-I8F1NzpbaDxj4hD4xlDZIQI9PxLq4nAtb4ZVQC1xhnRv-uufs9Wa4XFjs6jJSWGcWV1Z7K5HmMaw","kid":"tNtnDgeXepbf2NZlVjzKGdtPU9mnOidtw0puo3s-_8Y","kty":"RSA","use":"sig"},{"alg":"RS256","e":"AQAB","n":"o_CYYN5Lo9XuCRADNxqDTVolcWshv7LD7EmwFCvtbdHErvfOQPHyAFMLMDKracToe2Rg7cBihYC_wgHRItXAgxAM6P7mNT_DvbLpp2HtbMtmYLtWyGqHJsJQE9gNSOMsxEugxq9lpGjROiU2nZm7TZ-QwVV-F7dfBl0NBVy5oFbTCRUDxFcKOr_zh3xK-fRIsJbqbB4VPt8IhA_GjvjyoMlH0pfhoRqDMWk8vLXHhRxYlT5bZP1PDulFMGGO8KH7Cvh4D0cZE9mSiUFyVlDDzCbAH88a0TAGYkqERdVfHBYaTsCCseBqsvUoqbdzQwd2fOLf-N0jpSdNMNxHGNwl3w","kid":"ddPUDDyUpH2N5wGSXvnqQZy-OmTFSVu5PYansjpsoAs","kty":"RSA","use":"sig"}]}`)